LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-VISA: Can this be a memory-problem to not use the refeference?

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

0 Kudos
Message 1 of 5
(1,247 Views)

Hi!

I think you can use NI I/O Trace to check what's actually happening.

 

Regards,

Marco

0 Kudos
Message 2 of 5
(1,214 Views)

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.


GCentral
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 3 of 5
(1,200 Views)

Ok, in I/O-Trace it only Opens once the session and later Visa is only reading and writing. No other open visible.

 

0 Kudos
Message 4 of 5
(1,191 Views)

@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.


GCentral
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 5 of 5
(1,187 Views)