How to solve IOException ?

MTKNTS

New member
Joined
Jan 29, 2015
Messages
1
Programming Experience
1-3
I have a Vantage Pro2 which is weather instruments system. My communication with it is by serial port. When I command to it, it gives back me an acknowledgment character and 99 bytes array of data.
But after some minutes I get the following error:
IO Exception was unhandled

An unhandled exception of type 'System.IO.IOException' occured in System.dll
Additional Information: The I/O operation has been aborted because of either a thread exit or an application request
I run a lot of tests and I almost believe the problem is due to the C# NOT to my Vantage. Is there any idea?

private void VantageserialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
    VantageReadInterval.Enabled = false;
    VantageserialPort.Read(VantageData, 0, 100);
    // jj++;
    //  SetText(jj.ToString());
    //label23.Text = jj.ToString();
    this.Invoke(new EventHandler(VantageUpdateVar));
}
The error occurs on the VantageserialPort.Read(VantageData, 0, 100); line
 
Last edited by a moderator:
Top Bottom