Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Abnormal shutdown:VI_ERROR_CONN_LOST(-1073807194)

Solved!
Go to solution

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

0 Kudos
Message 1 of 2
(4,802 Views)
Solution
Accepted by topic author xiaochouyu

Solved. Add a decision before opening VI. if it is open, close it first.

 

 

 

status = viOpenDefaultRM(defrm) 
If vi0 <> 0 Then
status = viClose(vi0)
End If
status = viOpen(defrm, viaddress, 0, 0, vi0) 

0 Kudos
Message 2 of 2
(4,793 Views)