G
Guest
I am trying to send a 6 byte char array from the serial port in new C# 2005
Express:
com.Write(new string(new char[] { (char)34, (char)14, (char)192, (char)51,
(char)0, (char)0 }, 0, 6));
I am receiving 34,14,63,51,0,0 from the port as I connected Tx and Rx pins
to each other by using the following code:
private void com_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
bytes = com.BytesToRead;
if (bytes >= 6)
com.Read(buffer, 0, bytes);
}
The hard thing to understand is: in this array if I replace 192 with 127 or
any number below I get the array back as it is. Any number above 127 is
received as 63.
Any ideas about the underlying reasons for this?
Express:
com.Write(new string(new char[] { (char)34, (char)14, (char)192, (char)51,
(char)0, (char)0 }, 0, 6));
I am receiving 34,14,63,51,0,0 from the port as I connected Tx and Rx pins
to each other by using the following code:
private void com_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
bytes = com.BytesToRead;
if (bytes >= 6)
com.Read(buffer, 0, bytes);
}
The hard thing to understand is: in this array if I replace 192 with 127 or
any number below I get the array back as it is. Any number above 127 is
received as 63.
Any ideas about the underlying reasons for this?