C# SerialPort Problem
Posted on 2010-08-26
I have a Fiskal Cash Register Printer, which has got the following communication protocol for sendin data to it.
So I wrote a function called getCommand that has got as parameters the CMD, SEQ and DATA. Everything else is being calculated By the function which returns a byte array.
then I do the following
serialPort serial = new serialPort("COM1", 115200);
serial.Write(getCommant(CMD, SEQ, DATA), 0, Size of returned by getCommand);
private void serialPort_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
private void serialPort_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
I also make an event for DataRecieved and ErrorRecieved, which have the following codes.
And when I send the data to the fiskal printer it doesn't do anything. I doesn't even give me an error.