I/O operation has been aborted

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<div id="x_post_message_4180887
Hi All,<br/>

Im new to VB and was doing my project when I came across an error
(The I/O operation has been aborted because of either a thread exit or an application request) regarding this code:<br/>
<br/>
"Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived<br/>
<br/>
If closingdown = False Then<br/>
<br/>
received = SerialPort1.ReadTo(vbCr & "R") Motion port receiving data. needs a vbCR & "R" is sensor out is an ASCII "R" followed by three characters(which is the distance measured)<br/>
<br/>
End If"

It only occurred on "received = SerialPort1.ReadTo(vbCr & "R")".<br/>
However sometimes this error is not shown, but most of the time it does occur. <br/>
This error only occur when i want to close the form. Other than that its perfectly alright.

Thank you!


View the full article
 
Back
Top