Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

what is the best way to handle multiple instrument visa sessions within an application

In an application where you need to control several instruments, what is the best way to handle the visa sessions. I am using a state machine, where each case is a seperate test and would use different instruments.
0 Kudos
Message 1 of 5
(3,856 Views)
If you have multiple instruments you're best option is to use a state for each instrument action.
Each instrument has its own visa resource name and a test is simply a list of states to execute.

if you have a more specific question I can give a more specific answer
greetings from the Netherlands
0 Kudos
Message 2 of 5
(3,845 Views)

Basically, I wanted to keep the clutter down in the diagram. I was using shift registers for the sessions, one for each instrument, where I opened a session for each in an initialization state. Then each test state I wire in the session(s) I need for that test, then in the quit case I close all sessions.

Does this make any sense?

I was going to try to cluster the sessions and uncluster in each state the needed sessions, so there would be just one shift register.

I don't have much experience so I thought I would ask for advise.

0 Kudos
Message 3 of 5
(3,831 Views)
The idea of clustering the visa resource names makes your program better readable and so less error prone.

If you look carefully, you will most of the time act on one instrument at a time, wit a few calls to the driver.
If you need to addres multiple instruments in the same state, maybe it is better to have a level between your instruments and your main vi.

A kind of functional global or action engine as Ben Rainer calls it.
search for action engines in the LabVIEW forum and it should come up.
This helps to make it easy to exchange instruments from different vendors when needed.
greetings from the Netherlands
0 Kudos
Message 4 of 5
(3,821 Views)

Thank you for that, I did cluster  them last night and unbundled by name where appropriate, it worked and it did make the diagram a lot cleaner, I will look into the other idea you had tonight. I was trying to search for a similar concept, but sometimes if you don't know a target name you don't get the right hits.

Thanks again.

0 Kudos
Message 5 of 5
(3,806 Views)