I'm using Partner SP-550 Touch Computer (POS PC) with EC-410 Cash drawer. There is a RJ-11 port in POS machine. It is labeled as cash drawer. I connect my Cash drawer to PC using that RJ-11 port. My Software developed in C#, So how can I write a command to open cash drawer in C#?
Asked
Active
Viewed 3,495 times
2
-
2That's a good question, but I think a little too broad for this website. – ProgrammingLlama Sep 14 '18 at 05:57
-
3I have recently worked with a cash register and I relied very much on the documentation and the functions that were made on the hardware device. I don't think we can help you with this since we don't know what's the code behind it. Just read the documentation, if the cash drawer has this function, you should find there how to use it. – Gabriel Stancu Sep 14 '18 at 05:59
-
1most are chained from the printer, and use a printing ESC sequence for the drawer kick, [for example](http://www.beaglehardware.com/howtoprogramcashdrawer.html) – Cee McSharpface Sep 14 '18 at 06:33
-
@dlatikay I need Directly access from PC – nirmalagoon Sep 14 '18 at 06:38
-
I don't have the manual for that particular model available, but I guess you should then install the manufacturer's driver that comes with the device on that PC, and send the command using the windows printing subsystem or even bypassing it, which is [described here](https://stackoverflow.com/a/2837923/1132334), [sample here](https://stackoverflow.com/a/2837810/1132334) – Cee McSharpface Sep 14 '18 at 06:59
-
[This page](https://www.partner.com.tw/download/#3606-cash-drawer-api-utility-sp-550) seems to be able to download device drivers, VB6 and Delphi samples, C/C++ and Delphi include files etc. Since there is no C# I/F, you will need to call the C/C++ DLL with P/Invoke. – kunif Sep 14 '18 at 07:43
1 Answers
5
You must connect your cash drawer to your printer and configure it to one port COM e.g COM2 and use the next code:
Encoding enc = Encoding.Unicode;
SerialPort sp = new SerialPort();
sp.PortName = "COM2";
sp.Encoding = enc;
sp.BaudRate = 38400;
sp.Parity = System.IO.Ports.Parity.None;
sp.DataBits = 8;
sp.StopBits = System.IO.Ports.StopBits.One;
sp.DtrEnable = true;
sp.Open();
sp.Write(char.ConvertFromUtf32(28699) + char.ConvertFromUtf32(9472) + char.ConvertFromUtf32(3365));
sp.Close();

Esteban Silva
- 83
- 8