tags:

views:

121

answers:

1

I need to open a cash drawer using C/C++ or Java. It is a POS-X cash box with a USB connection. I've never done anything like this before. I noticed the cash box was linked to the "COM3" port. I know Java does not have a USB API so I turned to C/C++.

+3  A: 

Forum post about it here.

In a nutshell, install the driver, change the COM3 baud rate to 9600, and send a "1" to the COM port.

Check out javax.comm for a method of communicating with a com port on java.

Karl Bielefeldt
This looks like something that might work. Thanks!
Alan
Though I cannot seem to find a link to download the Communications API.
Alan
RXTX might be what you need - see http://rxtx.qbang.org/wiki/index.php/FAQ#What_is_RXTX.3F
barrowc
`COM3` should be accessible from normal file I/O (even from Java) under the name `\\.\COM3`, or sometimes just `COM3` will work. Just open the file for writing, send `"1\r\n"` to it, and it should just open. That does sound like a *high security* cash drawer ;-)
RBerteig
I'm using C to solve this problem. I am I am able to create a FILE* reference to the COM3 port, I tried writing the value "1\r\n" to it, but I have been unsuccessful in getting any respose. What could be the problem?fputs("1/r/n", comport);
Alan