Ref: "ProgGuide1_7.docx"
Page 15 of 26
Document Revision: “1.7”
Document Date: “11 Sep. 2013”
Initialise and Request Status Commands
ESC,"@"
1BH,40H
Initialise printer
Clears print parameters to power-on default, ie normal width and height, no underline, no extra
space, and default tabs. Does not affect the inverted mode. Not real-time, executed in data
sequence (unlike CAN).
CAN
18H
(Real time) Abort printing and initialise
@
Same result as ESC,'@' but executed immediately when received. A line in progress is allowed to
finish, but printing then continues from data received after the CAN code. Ignored if embedded in
an ESC, GS or graphics sequence.
GS,ENQ
1DH,05H
(Real time) request for printer status
+
This command is executed and the STATUS byte is transmitted immediately on receipt, even if the
printer is busy. See the section CODES TRANSMITTED for format.
GS,"I",..
1DH,49H,n
Request to transmit information
+
See the section QUERYING INTERNAL CONFIGURATION INFORMATION below for format.
GS,"L",..
1DH,4CH,n
Exit Spool Mode and Transmit confirmation data
@
If spool mode is entered by ESC, L command and this command is used to exit from spool mode,
confirmation of the number of bytes sent whilst in spool mode will be returned. The sequence on
exiting spool mode is;
(i) Transmit initial confirmation string with data packet information
(ii) Exit Spool Mode
(iii) Print all spooled data from buffer
(iv) Transmit final confirmation string
When the
GS,’L’
command is received a 4 byte confirmation string is transmitted by the printer as
follows:
STX ByteCountLo ByteCountHi CheckDigit
[02h] [06h] [00h] [4Fh]
ByteCount is transmitted as two consecutive bytes such that (ByteC (ByteCountHi x 256) )
gives the actual ByteCount value. In this case, there are 6 data bytes between the ESC,’L’ and
GS,’L’ commands, and the result of a cumulative XOR of each of these 6 bytes yields 4Fh as the
CheckDigit.
The printer then exits from Spool mode and processes the data which has been held in the buffer in
the normal way. Once the data buffer is completely empty and the mechanism is no longer running
(as normally reported by bits 1 and 2 of the STATUS byte), then the packet of data is judged to
have been processed completely. At this point a further confirmation string is transmitted as follows:
ETX ByteCountLo ByteCountHi CheckDigit
[03h] [06h] [00h] [4Fh]
Note that the first byte is STX for the first string and ETX for the second string.
The final 3 bytes are identical in both strings.