Hi Emre,
See the IBM SurePOS 500/600 Reference manual (Page 65):
ftp://ftp.software.ibm.com/software/retail/pubs/hw/4840/blp2mst.pdfIn IBM Cash Drawer, by sending <XCT 07> in Header Template (COM4 serial port), I am able to open the cash drawer 1. What I want is trigger a timer for 1 minute and when timer expires, check cash drawer status by sending <XCT 06> and read a byte from serial port (COM4) and see if bit 6 is 1, if it is 1 means cash drawer is open. If it is open, display a message asking user to close the cash drawer. Once it is closed, the message should disappear.
Copied below details from page 65.
Open cash drawer 1 : 07
Purpose" To open cash drawer 1, use the command (07), which sends an ASCII
Bell character to the character-display serial port.
Open cash drawer 2 : 1B 07
Purpose:
To open cash drawer 2, use the 2-byte sequence (1B 07) , which sends an
Escape character followed by an ASCII Bell character to the character
display serial port.
Read cash-drawer status : 06
Purpose: To obtain status information for cash drawers, use the command (06),
which sends an ASCII ACK character to the character display serial port.
See “CD status byte format” for a description of the cash-drawer status
byte.
Unsolicited cash-drawer status : 1B 06
Purpose: To toggle the unsolicited cash-drawer status function on or off, use the
following 2-byte sequence(1B 06), which sends an Escape character followed by
an ASCII Ack character to the character-display serial port.
The default setting is OFF. If the unsolicited status function is ON, the system checks
cash drawer status approximately every 500 ms. Any status change causes
the return of the status byte. Also, if unsolicited status is on, sending an
Open command causes the cash drawer to return a status byte. See “CD
status byte format” for a description of the status byte.
CD status byte format
CD1 CD1/CD2 Status Byte
Bit 7 Always a 0, for compatibility
Bit 6 Cash drawer 1 sensor
v ’1’ = Cash drawer 1 open (if connected)
v ’0’ = Cash drawer 1 closed
December 7, 2001 Input/output device commands
Chapter 7. Input/output devices and commands 65CD1 CD1/CD2 Status Byte
Bit 5 Cash drawer 2 sensor
v ’1’ = Cash drawer 2 open (if connected)
v ’0’ = Cash drawer 2 closed
Bit 4 Cash drawer 1 present indicator
v ’1’ = Cash drawer 1 is present
v ’0’ = Cash drawer 1 is not present
Bit 3 Cash drawer 2 present indicator
v ’1’ = Cash drawer 2 is present
v ’0’ = Cash drawer 2 is not present
Bit 2 Unsolicited status function state
v ’1’ = Unsolicited status function is currently ON
v ’0’ = Unsolicited status function is currently OFF
Bit 1 Reserved always 0 for compatibility
Bit 0 Reserved always 0 for compatibility
Purpose:
To obtain status information format for a cash drawer, send read status
command. The system also supports unsolicited cash drawer status.