LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send and Get data from multiple visa instruments

Solved!
Go to solution

Hi,

I need to write to many visa instruments as fast as possible and get measurements. Is writng the vi this way will ensure all the commands will be send to the instruments almost at the same time, and than each device will send it response? 

Also the code is very messy, is there a way to write it better?

Thanks.

Download All
0 Kudos
Message 1 of 5
(2,595 Views)

Personally, I like having a loop for each instrument and then you command that loop to do whatever via a queue.  You can get the data back via a queue, notifier, global variable, etc.  This helps to segregate each part and allow for continuous measurements.  Do a good search for Queued Message Handler for some ideas.



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 2 of 5
(2,540 Views)

This is what I am using now, but each time I measure I need to measure with all the instruments almost at the same time. So i have this sub-vi that calls all of them together. But is there a way to write the code better?

If I will use separate loop for each instruments they wont be synchronized.

0 Kudos
Message 3 of 5
(2,524 Views)
Solution
Accepted by topic author PokiBono5

@PokiBono5 wrote:

This is what I am using now, but each time I measure I need to measure with all the instruments almost at the same time. So i have this sub-vi that calls all of them together. But is there a way to write the code better?

If I will use separate loop for each instruments they wont be synchronized.


Honestly, there really is no way to write the code better.  You must depend on hardware to synchronize your system!

 

I see that you have implemented VISA sessions of class instr.  If these instruments are on a single GPIB bus a *GET would trigger each instrument to start at the exact same time if they were set to trigger on a bus trigger.  If you are on a parallel serial bus (RS-485, CAN....) you could send a broadcast message to start a software triggered event, If they are on a 1:1 serial bus (TCP/IP raw socket, USB, RS-232....) you need a hardware trigger.


"Should be" isn't "Is" -Jay
Message 4 of 5
(2,514 Views)

Thank you.

0 Kudos
Message 5 of 5
(2,506 Views)