LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is "Open VISA" a legacy function? To open or not to open that is the question

Any visa function such as Configure, Write, Read, etc. automatically opens the visa port, so why would you ever use the VISA Open block unless you wanted to set the access mode or the duplicate session?

 

My programs all have the same format, but they may be antiquated.  

 

Initialize

 -Open VISA

 -Configure VISA

 -Configure port (serial, etc.)

LOOP

 -Write/Read

Cleanup

-Close VISA

 

Is the open visa unncessary?  Should I just configure and skip the open?

 

 

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 1 of 5
(4,301 Views)
I haven't used the Open function in quite a while. The Close, however is something I still do.
0 Kudos
Message 2 of 5
(4,298 Views)

By including an explicit open, you can use the error out to determine if the VISA name is valid and actually available before configuring it.

 

 

Think of it sort of like listening for the dial tone before dialing digits.

 

http://digital.ni.com/public.nsf/allkb/A2561CDE98B66DD4862566510078264F

 

Message 3 of 5
(4,285 Views)
Though you will get the same error if you don't use the open.
Message 4 of 5
(4,275 Views)

@PhillipBrooks wrote:

By including an explicit open, you can use the error out to determine if the VISA name is valid and actually available before configuring it.

 

 

Think of it sort of like listening for the dial tone before dialing digits.

 

http://digital.ni.com/public.nsf/allkb/A2561CDE98B66DD4862566510078264F

 


Re Dial tone:  like VISA Open, I haven't heard a Dial Tone on my Cell for quite some time.

 

VISA has gotten a lot smarter in the last decade.  If a session exists to a named resource within the application that asks for access to it, it is used, if not one is attempted to be opened.  There is an ini option to automatically close VISA sessions when the top level vi goes idle (this can be helpful if you are bouncing between PuTTY and LabVIEW but a real pain with some of the load / unload options in TestStand Sequences)

 

The ONLY VISA Session property that appears to have a need for an explicit Open and wired IO sessions through all modules is "User.Data"  (I never did understand why that property does not "Properly" persist with implicitly re-opened sessions)


"Should be" isn't "Is" -Jay
Message 5 of 5
(4,267 Views)