CMartin,
Well, you are trying to read an entire line, but when the DataReceived
event is fired, it isn't guaranteed that an entire line is available. Can
you read one character at a time?
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"CMartin" <CM*****@discussions.microsoft.comwrote in message
news:D0**********************************@microsof t.com...
>I am trying to use code below to read data form the port. I know it is not
correct but I am not finding what I need in MSDN to help me.
private void serialPort1_DataReceived(object sender,
SerialDataReceivedEventArgs e)
{
string getRelayStates;
getRelayStates = serialPort1.ReadLine();
MessageBox.Show(getRelayStates);
Any ideas?
thanks