Cognitive Solutions A776 All in One Printer User Manual


 
Chapter 5: Programming commands82
A776 (B780) Programming Guide A776-PG00001 C 12/09
Status
Status command introduction
The A776 has three methods of providing status to the application. These methods are through batch status
commands, real time status commands and unsolicited status mode. An application may use one or more of these
methods to understand the current status of the printer. A brief description of each of these methods follows.
Batch status commands – These commands are sent to the printer and stored in the printer’s buer. Once the printer
has processed all the previous commands these commands are processed and the proper status is returned to the
application. In the event a condition causes the printer to go BUSY, it stops processing commands from the printer
buer. If a batch status command remained in the buer during this busy condition, it would not be processed. In fact,
no batch commands are processed while the printer is in this state.
Real-time commands – These commands are sent to the printer and stored in the printer buer. Periodically,
when the printer has time, it scans the input buer looking for these commands. When found by the printer, these
commands are processed immediately. This gives the application the ability to query the printer when it is in a busy
state in order to correct whatever fault has occurred.
Unsolicited status mode – This mechanism allows the application developer to program the printer to automatically
respond with a four byte status when certain conditions in the printer change.
Please see the subsequent sections for a more detailed description of these status commands. At the end of this
status commands section is a page entitled “Recognizing data from the printer”. This describes how to interpret what
command or setting (in the case of unsolicited status mode) triggered a response from the printer.
Batch mode
For RS-232C printers, these commands enable the printer to communicate with the host computer following the
selected handshaking protocol, either DTR/DSR or XON/XOFF. They are stored in the printer’s data buer as they are
received, and are handled by the rmware in the order in which they are received.
When a fault occurs, the printer will go busy at the RS-232C interface and not respond to any of the batch mode printer
status commands. If the fault causing the busy condition can be cleared, such as by loading paper, or letting the
thermal printhead cool down, the printer will resume processing the data in its receive buer.
Transmit peripheral device status
ASCII ESC u 0
Hexadecimal 1B 75 0
Decimal 27 117 0
Value of returned byte:
Bit 0 Bit 1
1 = Drawer 1 Closed 1 = Drawer 2 Closed
0 = Drawer 1 Open 0 = Drawer 2 Open
Bits 2–7 are not used.
Transmits current status of the cash drawers. One byte is sent to the host computer. In DTR/DSR protocol, the printer
waits for DSR = SPACE. If a drawer is not connected, the status will indicate it is closed.
Exceptions
Unlike the A756, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, the
A776 has a single connector that shares data reporting from either cash drawer. When either cash drawer is open, an
open status for both drawers is reported by the printer.