Hi All,
I'm guessing this is the right place for this but in an app to interface to a board I have found an oddity,
the boards returns :
UD:0010=H2000950463700045160077129#0D#0D
this is picked up by my code as
UD:0010=H2000950463700045160077129 >23
it appears that the following happens the data comes back (why there is two line feeds I can find out my end) but #0D changing into ' >23' is a little strange, I would be expecting a 23 as thats the hex for #
but space > or 20h 62h leaves me a little worried at the event handler
private void port_DataReceived_1(object sender,SerialDataReceivedEventArgs e)
{
// MessageBox.Show("Here!!");
InputData = myComPort.ReadExisting();
if (InputData != String.Empty)
{
this.BeginInvoke(new SetTextCallback(SetText), new object[]{ InputData});
}
} the set text function is
private void SetText(string text)
{
this.rtbIncoming.Text += text;
if (text.Contains("OK"))
{
return;
}
if (text.Contains("ERR - No Data"))
{
MessageBox.Show("ERR - No Data");
}
if (text.Contains("UD:"))
{
rtbIncoming.Text += '\r' + '\n';
ProcessReturnedData();
}
}
void ProcessReturnedData()
{
rtbReturnedData.Text += rtbIncoming.Text+'\r'+'\n';
}