09-08-2014 04:22 AM
Hello,
i have 50 identical LAN-instruments, their IP-addresses are stored in a text-file that is read into a global-array-variable that contains then 50 times the string TCPIP0::192.168.0.0XX::inst0::INSTR where XX is the IP-address.
When starting my program i execute in a loop:
As input for "VISA resource-name" i pass the IP-string from the global variable.
But i DONT save the returned "VISA resourcename out"
Later in the program where i use a lot "VISA Write"-vis there i also pass the IP-string from the global-variable.
Now the question: Does this always create new visa-sessions when i do it like this?
Should i save the created "VISA resourcename out" in a globald-variable and use it as input for the VISA-write-vis?
Thx for help
09-08-2014 06:49 AM
Hi!
I think you can use NI I/O Trace to check what's actually happening.
Regards,
Marco
09-08-2014 07:10 AM
I want to say you are constantly opening and closing the VISA resource. As already said, use the I/O Trace to check on that.
In general, it is best to open the VISA session at the start of the program, store it somewhere, and then close it at the end of the program.
09-08-2014 07:31 AM
Ok, in I/O-Trace it only Opens once the session and later Visa is only reading and writing. No other open visible.
09-08-2014 07:41 AM
@OnlyOne wrote:
Ok, in I/O-Trace it only Opens once the session and later Visa is only reading and writing. No other open visible.
Then it sounds like LabVIEW is smart enough to look up the VISA Session and open it when it doesn't already have it open. Make sure you are closing these sessions at the end of your program just to make sure you aren't leaking.