Link to home
Start Free TrialLog in
Avatar of Aenon Netgear
Aenon NetgearFlag for Gibraltar

asked on

How to create an .exe or .bat file (or similar) to open a cash drawer over a serial port?

I need to be able to open a cash drawer without using a printer. The cash drawer connects to a Point of Sale device via an RJ11 cable/connector.

I'm not sure the best way to create the file to send the code to send the open and close command.

Can anyone help?


The POS manufacturer's sample commands are:

Cash Drawer Controller Register
The Cash Drawer Controller use one I/O addresses to control the Cash Drawer.
Register Location: 48Ch
Attribute: Read / Write
Size: 8bit

Cash Drawer Control Command Example
Use Debug.EXE program under DOS or Windows98

Command    Cash Drawer
O 48C 04     Opening
O 48C 00     Allow to close
 Set the I/O address 48Ch bit2 =1 for opening Cash Drawer by “DOUT
bit0” pin control.
 Set the I/O address 48Ch bit2 = 0 for allow close Cash Drawer.

The full PDF is here -
https://aures-support.com/DATA/Doc/POS/SANGO_User_Manual_V1.0(EN).pdf  
(Page 18)
Avatar of ste5an
ste5an
Flag of Germany image

Did you run the debug command as specified?
Avatar of Aenon Netgear

ASKER

No, because it's a 64 Bit OS (Windows 10) and debug.exe isn't available.

You need to run those command on the POS, not your machine.
Yes, I understand that. Both the POS and my machine here are Windows 10. I'm downloading a newer Windows Debug machine, but I've never used it before. I'll have to see if this is obvious...
I'm not sure how to enter code into the WinDBG program. I can see how to open an executable into it.
I'm not sure how to enter code into the WinDBG program. I can see how to open an executable into it.
Won't work imho. Cause the document is using a DOS/BIOS integration, in Windows 10 it must work differently. But this is not documented.
There's a test tool that can be run that brings up a simple interface and there are Open and Close buttons.
The POS hardware definitely works in the Win 10 OS.
The POS hardware definitely works in the Win 10 OS.
But  not as documented in the link you've posted. There you use debug to call a BIOS function to open the drawer. These kind of BIOS function calls do not work in a modern PC with Win10.

There's a test tool that can be run that brings up a simple interface and there are Open and Close buttons.
The it is simple. Download SysInternals PortMon and ProcessMonitor. When it is serial port over USB or TCP/IP, then you'll see the necessary calls in PortMon. If it's somehting different, then you can see in ProcessMonitor the used libraries.
I'm struggling to identify the exact process. There are far too many going on.

There's an ini file for the test tool:

[Title]
FormTitle="CashDrawer for I/O 482"

[Address]
IN="482"
OUT="482"
[Port1]
OPEN="10"
CLOSE="00"
SBIT="08"
[Port2]
OPEN="00"
CLOSE="00"
SBIT="00"

And also a .dll.

I don't know how to make use of it though.
The test utility is here: aures-support dot com/en/sango-2/sango-drivers-eng/




ASKER CERTIFIED SOLUTION
Avatar of Aenon Netgear
Aenon Netgear
Flag of Gibraltar image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial