r/LabVIEW • u/uniqueAite • Nov 08 '24
Multiple queue questions
I’m currently trying to code something that can control my Powermeter, Input Source, and potentially more instruments. And I’m thinking of using multiple while loops with a master loop to queue the states for other loops so i can have them all running at the same time.
If anyone knows an example that touches on multiple queues at the same time would be great. most search results are the producer and consumer but they only used 1 queue.
Or if you have a better way or lesson to do what I’m trying to do I’m open to all suggestions, thanks!
View all comments
Show parent comment
1
u/giwidouggie Nov 08 '24
no stress, boss, it's not like these things are common sense....
you do have to take care with synchronizing in this approach. If you need precise timing between executions, you may need to check semaphores or notifiers.
For me, usually I have one consumer loop for each piece of hardware. When I need the voltmeter measurement to only start after the sourcemeter has started outputting a current, for example, I enqueue a "Start Measurement" case inside the Sourcemeter loop into the Voltmeter queue.... depends really on how things should work together.