Hi everyone, I am using Visual Studio 2013 (C#) in order to test serial port. I have an array of bytes and I am trying to send it via Serial Port using two USBSerialConverter. The data that I receive is between 14 to 18 bytes of lenght (it change everytime i execute the code), not 30 as the size of array.
byte[] tx_Data = new byte[30];
...
string bitString = BitConverter.ToString(tx_Data);
Console.WriteLine(bitString);
serialPort1.Open();
Console.WriteLine(tx_Data.Length);
serialPort1.Write(tx_Data, 0, tx_Data.Length);
serialPort1.Close();
The Console.WriteLine from this code is:
4F-42-2D-30-35-30-34-2D-32-34-33-36-2C-0C-01-13-17-33-09-0F-0F-0A-1E-58-00-00-00-00-C8-26
30
but I receive something like.
4F 42 2D 30 35 30 34 2D 32 34 33 36 2C 0C 01 13
What I could be doing wrong?
thanks for your help.