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
2010-09-30 23:45:29
This looks like something that might work. Thanks!
Alan
2010-10-01 00:53:56
Though I cannot seem to find a link to download the Communications API.
Alan
2010-10-01 00:56:48
RXTX might be what you need - see http://rxtx.qbang.org/wiki/index.php/FAQ#What_is_RXTX.3F
barrowc
2010-10-01 03:03:17
`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
2010-10-01 06:43:17
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
2010-10-02 01:25:41