nirmalagoon
nirmalagoon

Reputation: 21

How to open cash drawer directly in c#

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#?

Upvotes: 2

Views: 4249

Answers (1)

Esteban Silva
Esteban Silva

Reputation: 83

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(); 

Upvotes: 5

Related Questions