Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA port cannot be opened after disconnecting a device and reconnecting it

I have this very annoying problem in LabView (2014): I have devices that I'm communicating with over a virtual COM port (VISA). If I erroneously disconnect or power off that device while my VI is running, then I get an error, which is normal - but if I repower or reconnect the device, the VI will never run again and gives the following error:

 

Error -1073807343 occurred at VISA write in xy.vi

Possible reasons: (Hex0xBFFF0011) insufficient location information or device or resource is not present in the system.

 

When this happens, I can still see the COM port in the COM port list (placing a control on the front panel); But it's marked as connected. It appears to me that if I unplug the cable, VISA doesn't properly close/release the port and it remains there as some kind of zombie port, and when I reconnect my device, it still can't access it because the old error is still there.

The only thing that helps is to restart LabView, which is a bit of a nuisance.

 

Can anyone suggest how to solve this without restarting LabView?

0 Kudos
Message 1 of 3
(3,314 Views)

Close the VISA session when you get the error.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(3,292 Views)

Alternatively you can unconditionally close the reference before you try to open it, and ignore/clear the warning produced from an uninitialised reference.


GCentral
0 Kudos
Message 3 of 3
(3,275 Views)