User manual

!
USER MANUAL |
!
21!
PROTOCOL MODE
Protocol mode is active when hardware switch 11 is on. The purpose of this
mode is to give stronger real time access to the printer. All input data are sent
in packets as described below. The printer returns an answer to the packet
immediately.
Output packet format: Channel Command LenHi LenLo Data
Answer format: Channel Status LenHi LenLo Data
Channel: One byte:
Bits 0 – 6 Channel number (Device type)
Bit 7 0: Send data; 1: Response
Command: One byte with possible value:
• 0: Open channel (No action – all channels always open)
• 1: Close channel (No action – all channels always open)
• 2: Send data
• 3: Request data
• >4: Application specific
Status: One byte:
0
1
Bit 0
No error
Error occured
Bit 1
ACK (Packet accepted)
NACK (Packed not accepted)
Bit 2
Channel and command OK
Wrong channel or command
Bit 3
Battery OK
Low battery
Bit 4
Printing head OK
Printing head too hot
Bit 5
Paper OK
Out of paper
Bit 6
Not defined
Bit 7
Printer ready
Printer busy
Table 6
Bit 7 is set, if:
• There are unprinted lines in the print buffer.
• There are bytes in the print buffer.
• The printer is executing a macro.
• The printer is executing selftest.
• The button <LF> is pressed – feeding paper.
LenHi: High byte of data length of data. 00h to 08h.
LenLo: Low byte of data length of data. 00h to FFh.
Data: 256*LenHi +LenLo data bytes.
The maximum packet length is 2048 bytes.
The answer differs from the command by bit 7 (MSB) in the channel number. If bit 7 is 0 then it
is a command, if it is 1 then it is a response. Bit 0 in the status byte shows if there was an error
accepting or processing the data block. If this bit is 1 the other bits show the type of the error.
The printer never issues a transmission by itself. It always responds as an answer to a command.
The communication goes like this:
Host – command, Printer – answer; Host – command, Printer – answer; etc.