LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Session Open/Close Twice

Hello,

I have been using the following code to simply read a voltage from a digital lock-in amplifier. For some reason, the lock-in does not respond to my manual settings adjustments in the code I've provided. If I isolate the left session, the lock-in updates as expected, and if I isolate the right session, the lock-in provides me with a voltage as expected. However, when the two sessions are used in the same document, only the right session works. Does anyone know what the problem is/how to fix it?

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

You are actually opening and closing more than twice.  You are opening and closing on every iteration of that while loop.

 

Open our VISA session once at the beginning of your code.  Then close it once after you while loop has completed.

0 Kudos
Message 2 of 4
(2,116 Views)

Thank you for pointing that out. If I still want to read something every time the while loop executes, can I have two VISA Writes connected to each other across the sequence structure?

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

Of course!

0 Kudos
Message 4 of 4
(2,079 Views)