From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Recover from VISA error 1073807194 after instrument power cycle

Solved!
Go to solution

Hello, and thanks in advance,

 

I connect to an instrument via VISA with the instrument's IP address and port. This normally works well, but if the instrument losses (and regains) power while the VI is running, LabView must be restarted for the VI to work again. (That is the whole labview, not just my VI). Error code: 1073807194 | VI_ERROR_CONN_LOST | The connection for the given session has been lost. No such instabilities occur when the connection alone is disrupted and restored. It is still a valid resource in VISA. Can I solve this by clearing the port or socket, and if so, how? I hope to insert some code to check whether the connection is obstructed, and if so, clearing it.

 

I am running LV 8.6 on Windows XP using Measurement and Automation to assign the the VISA resource by manual selection of socket. The VI is attached.

 

This thread looks useful, but the links are dead: http://forums.ni.com/t5/LabVIEW/visa-write-connection-has-been-lost/m-p/342028.

 

Thanks very much!

Message 1 of 5
(16,508 Views)

A little bit of an update. I find that I still have access to the instrumetns if I connect directly via internet, indcluding using LabView as the means.

 

I have also tried using keep- alive packets, and it seems the result is that my errors are now of the timeout variety. I can send commands, but the response is delayed by several minutes regardless of the timeout window.

 

Anyone have any ideas how to reestablish and repair the connection in VISA???

 

Thanks!

0 Kudos
Message 2 of 5
(16,460 Views)
Solution
Accepted by topic author Warren Harding

When you exit LabVIEW and restart, LabVIEW automatically closes all the VISA Sessions.  Try using the VISA Close function to close the existing session and then open a new one.

Message 3 of 5
(16,445 Views)

Wow, I do have N opens and N-1 closes i nthe main code. Thanks for catching that! Looks like it is working now.

Message 4 of 5
(16,441 Views)

I am seeing the same problem. Is there a way to see how many VISA sessions I have open? I believe there is only one as the "duplicate session" input is set to false.

 

As soon as I get this error, I can't recover from it without restarting LabVIEW. All the time I can communicate to the instrument using MAX while my LabVIEW code continues giving me this error.

Message 5 of 5
(16,360 Views)