LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Open/Close

Hi all,

how it is possible to open a visa-session with a event-structure like in this vi? I'll open the visa-session and than i'll will use other functions like the read-button. But this makes only sence, when the visa-session is open. If you press disconnect, than the visa-session can be closed. But how shoult i Do this?

Can you help me please?

Thanks Thomas
0 Kudos
Message 1 of 3
(2,734 Views)
can you just open it once outside your while loop and pass the resource either directly with a wire or in a global.. and close it again after your program completes by placing the Visa Close outside the while loop too ??? also you dont need to wire the boolean to your case structure within the event structure , you can wire the NewVal to the case , thats what they are there for...

Dan
0 Kudos
Message 2 of 3
(2,730 Views)

I've attached a modified version of your VI. You could do it this way with a shift register to pass the VISA reference or as Dan mentioned. I added an event for the read as well. In the connect event, I added a property node to enable the read button. The disconnect event has a property node to diable it. You should also note that you really don't have to do the connect/disconnect with a button. Typically, the connect woould be done before the main loop of the VI runs and then the VISA close is done when the main loop stops. Unless there's a reason to connect/disconnect multiple times during your program, you might want to think about that.

You're asking some pretty basic questions. You might also want to look at some courses or on-line tutorials. Check the LabVEWI Learning Center for some links to both.

0 Kudos
Message 3 of 3
(2,718 Views)