HI:
When the device is shut down abnormally, connect VI and an error of "the IO connection for the session has been lost" will be reported. The solution I found on the forum is to turn off VI and then turn it back on. However, errors will still be reported.
The current solution is to restart the software. Why?
Thank you
Private Sub VI_BtnCon_Click(sender As Object, e As EventArgs) Handles VI_BtnCon.Click
Dim viaddress As String = VI_txtDRS.Text
status = viOpenDefaultRM(defrm)
status = viOpen(defrm, viaddress, 0, 0, vi0)
If status <> VI_SUCCESS Then
VisaErrorHandler(vi0)
Exit Sub
End If
SEND_VISA(vi0, "*IDN?")
READ_VISA(vi0)
VI_txtIDN.Text = strRes
End Sub
Private Sub VI_BtnCLO_Click(sender As Object, e As EventArgs) Handles VI_BtnCLO.Click
status = viClose(vi0)
status = viClose(defrm)
End Sub