The text communications system works best as a request/response protocol, where the device
connected to the CLARiTY unit sends a command to the unit, and then waits for a response before
sending another command. In some cases it is possible to send a command before the pre vious
command has completed, but in most cases this will result in the second command failing.
To ensure that the commands you need are available and that the correct protocol mode is in use
enter the Tools screen, the press the Diagnostics button followed by Control, Communications and
finally select the Communication port that is set to use Text Communications.
The Text Comms Protocol item will now display the mode in use and installed version of the Text
Comms Protocol. For example Zipher ASCII Comms, the version 1 ASCII protocol or Zipher UNICODE
Comms v2, the version 2 UNICODE protocol.
More recent software releases (from June 2006) also support the Text Communications Protocol via
TCP/IP. This can be activated by using CLARiTYConfig to set the
System/TCPIP/TextCommunications/NetworkPort parameter to a non-zero value. The Text
Communications system will then wait for connections on the TCP port specified. Take care to
avoid using the same port number as other services that may be in operation, such as Binary
Communications (usually port 3001) or Master/Slave mode (usually port 3002).
A communications session comprises a set of commands or requests and responses. The carriage
return character (ANSI character code 13 decimal / 0x0D hexadecimal) terminates each command
or request, and also has the function of resetting the parser. This means that the carriage return
character will stop parsing the current data even if the data has partially matched a command or
request. The Carriage Return-Line Feed sequence ( 0x0D 0x0A ) is also accepted as a terminator;
the line feed character will simply be ignored.
The Get State Request (GST)
This request retrieves various state values from the printer.
Syntax
GST<CR>
Return Values
STS|<overallstate>|<errorstate>|<currentjob>|<batchcount>|<totalcount>|<CR>
Returns immediately.
Details
The GST request retrieves the following values:
overallstate
The overall state of the printer, as described for the SST command.
errorstate
The error condition of the printer. This will be one of the following:
0 No errors
1 Warnings present
2 Faults present
currentjob
The job selected in the printer. This will be empty if no job is selected.
batchcount
The printer’s batch count.
totalcount
The printer’s total count.
Examples
»GST<CR>
«STS|3|0|Default 4 Line Text|4345|8253|<CR>
The printer is running, there are no errors present, the currently selected job is “Default 4 Line
Text”, the batch count is 4345 and the total count is 8253.
»GST<CR>
«STS|4|2||0|8253|<CR>
The printer is offline with a fault, there is no job selected, the batch count is 0 and the total count
is 8253.