|
gablea on 10/18/11 - 17:09:21
Hi all
I need some help on something I have been trying to work out for 2 months now. I am trying to add cash drawer support to some EPoS sofware I am writing but at the moment I can not seen to figure it out. This is from the user manual for the terminal I am desgining the software for Cash Drawer The SureOne POS Terminal uses the industry standard Star interface for the cash drawer. Commands are actually written to the printer port and the printer electronics control the cash drawer. This interface can drive a 24 V cash drawer with drive current up to 1 A. In addition to the industry standard interface that opens a drawer and detects that it is open, the SureOne POS Terminal also implements the 4680/4690 function of detecting that the cash drawer is attached to the system when an IBM or compatible cash drawer is used. There is also a simple cash drawer interface for terminals not equipped with a printer. Cash drawer open status can be determined through the Enquiry <ENQ> printer command. There is also logic within the SureOne ASIC chip to drive the cash drawer in the event a printer is not installed. This circuitry is also used to tell if a cash drawer is physically attached to the system and to determine which circuit, printer or ASIC, controls the cash drawer interface. Control register S Cash drawer setup INDEX 28H: Read/write D7 D6 D5 D4 D3 D2 D1 D0 Function ------------------------------------------------------------------- x x x x x x x 1 disable C/D driver x x x x x x x 0 enable C/D driver x x x x x x 1 x C/D pulse = 100 mS (recommended) x x x x x x 0 x C/D pulse = 50 mS x x x x x 0 x x C/D controlled by prt logic x x x x x 1 x x C/D controlled by ASIC Control register T Cash drawer open via ASIC INDEX 29H: Write only D7 D6 D5 D4 D3 D2 D1 D0 Function ------------------------------------------------------------------- 0 0 0 0 0 0 0 1 Pulse C/D circuit (open drawer) Control register U Cash drawer status INDEX 30H: Read/write D7 D6 D5 D4 D3 D2 D1 D0 Function ------------------------------------------------------------------- x x x x x x 0 x IBM cash drawer connected x x x x x x 1 x IBM cash drawer not connected x x x x x 0 x x IBM cash drawer open x x x x x 1 x x IBM cash drawer closed can someone help me as I have NO IDea how to get the status bits from the comport (Com3) and to process it to see if the cash drawer is open or closed Com3 is set outside the software (via MODE COM3:9600,n,8,1) and the QB software can print to the port with no problem. if someone could help me with just getting the status from the printer and working out the status code (ie open or closed) I can do the rest of the work Thanks Andy
gablea on 10/18/11 - 17:44:40
some more information I have found as well that may help you all with the <ENQ> command
Function: Enquiry Code: <ENQ> 05h Outline: Causes the control board to transmit a status byte. For the Impact printer, when this code is received after receiving text data in the STX-ETX mode, the control board transmits the status and check byte. The status byte definition is as follows: Bit Definition 7 Cash drawer status, 0 = open 6 Printer buffer overflow = 1 5 Printer buffer empty = 1 4 Always 0 3 Paper empty = 1 2 Mechanical error = 1 1 Framing error = 1 0 Parity error = 1
Plasma on 10/21/11 - 23:20:38
Need the complete interface doc. Too much is missing from what you have posted.
gablea on 10/25/11 - 12:04:04
I have uploaded the manual for this terminal to my server IBM Manual here
on page 80 the manual talks about the <ENQ> fucntion and on page 95 the manual talks about the cash drawer support fucntion if someone could help me get this fucntion to work then I will be able to get the others to work as well. I WELCOME any help as I have never done status reading etc in any of my other programs
Plasma on 10/27/11 - 00:24:31
Reply to this message
Ok, there are two methods to get the cash drawer status. You can either use the integrated ASIC or the printer logic. I would use the ASIC method since it seems more reliable.
Here is the ASIC method.
Here is the printer logic method. The cash drawer must be configured for printer logic control. It also requires that the printer be in DTR mode and the data buffer is empty.
All code is untested since I don't have one of these things...if there are problems let me know. |
|