LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa write/read over socket and "Open"

Hello,

i have an instrument that i control over Lan and where i have to use socket communication.

Attached a screenshot of how it currently works.

I have to execute a visa-open bevor each write-command that it works. Normally (with other lan/gpib-instruments there is only ONE open at the beginning.

When i dont run this open with the special instrument-settings then it does not run.

Thats why i have to do this before each write.

 

So first questions is: Is there anoter way to execite visa over socket without "open"ing all the time?

And, will there be a memory-problem of all the open´s when i down do any close?

 

Thanks for the help

0 Kudos
Message 1 of 4
(2,405 Views)

Yes, you can use a single open for the session. You simply need to pass the session reference you get from the open and use that through your code. You should implement some error recovery because network connections can get closed for many different reasons. Your error recovery can open a new connection in the event the connection was lost. It would be a good idea to close the previous session before opening the new one.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(2,403 Views)

Is it possible to save a reference (from open) in a global-variable?

 

I don´t have a complete-program - the separate vis are called in teststand in a sequence of different vis (like open, configure, measure, ...).

So currently each vi has its own open.

 

0 Kudos
Message 3 of 4
(2,400 Views)

You can open the connection in a setup routine in your TestStand sequence and save the refernce to a sequence global. Pass this reference in to your subVI. Alternatively you could use a functional global (subVI with a shift register on a while loop) to hold the value. I never use atual LabVIEW globals themselves.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(2,398 Views)