January 3rd, 2013, 06:59 AM
How to open Cash Drawer that connect to a mini printer on Delphi 7?
I try to make some point of sales program that can support mini printer and cash drawer. I Have try some code from the others.
But it's not work correctly.
Anyone can help me to fix this?? Please???
January 3rd, 2013, 09:53 PM
From a quick glance I found nothing is wrong with the code (except the weird use of try except). So I think your problem might have caused by either one of these:
- Your computer's COM1 settings were different with one(s) acceptable by the cash drawer. Making failed communication. So consult your cash drawer's documentation. That approach in using serial port leaving you with default settings. So you have to do the adjustment in Windows Control Panel (System - Device Manager - Ports ...)
- You might want to try Write instead of WriteLn.
January 3rd, 2013, 10:47 PM
I use try except because the computer maybe hang if the program can't find the port that i use. so i catch them on some error message.
I have try use Write, but its nothing happen. cash drawer still wouldn't open. And the printer is connected to COM1.
Do you have another code to open cash drawer?
January 4th, 2013, 12:07 AM
I've never done worked with a cash register, so excuse me if this doesn't work, but have you tried
(Assuming that sequence of characters open the cash register - This link shows a slightly different sequence for an Epson Register)
January 10th, 2013, 09:17 AM
Thx for the code, the cause is setting on the printer.
There is properties that i must set to use a cash drawer function.
And the drawer can open now...
January 13th, 2013, 12:38 PM
Guys, how if the mini printer use USB port, i try with the same code above and change the port to USB1 like this :
But nothing happend, Cash Drawer still close... So Confuse.... .
January 14th, 2013, 12:21 AM
USB is not actually port. The name already suggested, it's bus for data traffic. You have to know what device at the end of the "port". If a device could be connected to a USB "port" and it claims that you can communicate with it through serial port, then it must have created a virtual serial port upon installation. You need to find this virtual serial port name.
What I usually done is by opening device manager then look for serial ports under "Ports" node, and then for each serial port I don't really know I would query it using software like HyperTerminal. Try send ATI3 command, usually device at the other end device will dump its basic identity information.
January 14th, 2013, 02:46 AM
Can i have some example how to send ATI3 command? I never heard like that before...
Or i read on some article that says, I must install USB to COM virtualitation, did you know how it's work ?
January 15th, 2013, 12:28 AM
That's mean you need to learn a bit more on usual "standard" in serial port communication. I suggest to google for "AT commands".
Originally Posted by BugzStriffe
If you have Windows XP installation, you can look for HyperTerminal in Start - Access - Communication. You can use it to manually communicate with your serial device. So it's great for testing. If you don't have XP, I believe you still can download HyperTerminal, google it.
Like I have said previously, that is what your device should have done upon driver installation, IF your device connects through USB. If your device has serial port, you can buy a USB-to-COM cable to "convert" your USB port to serial.
January 17th, 2013, 09:20 AM
It's work my friends... Thx for the answer...
My problem solved...