LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notifiers and Multiple Loops

Hi all,

I got some really useful help on another thread the other day with Notifiers and Queues.

I'm just a bit stuck with how to make Notifiers and Queues work with Multiple While loops.........

Some may suggest not using multiple loops, but I kind of have to - hard to explain.

I have a attached a dummy VI, which I'm fairly sure won't work, but in a style I want to achieve.

Notifier is set-up, then one loops sends the notifier, then the others 'consume' from this until the end of the chain where the notifier is released.

How would I make this VI work, is it fairly simple? when I run this style of VI in execution mode, it seems the loop that sends runs, but the subsequent consumer loops never actually iterate?

I'm assuming it's a similar situation for Queues too?

If anyone has any advice it'd be very much appreciated!

Cheers! Michael!
0 Kudos
Message 1 of 5
(3,251 Views)
First, if you wire the loops in series as you have it won't work as the second and third loops can't execute until their inputs are fulfilled, under LabVIEW's "data flow" paradigm, until they are passed the reference and the error cluster. But they won't get those until the first loop terminates and then the exit local will prevent them from running as well. If you put them in parallel, with the "obtain notifier" feeding all three it will be a start. You then probably want to feed the reference (and error cluster) into shift registers on the edges of the shift registers. The release notifier should be wired to the original loop (the one with the actual stop control). Using queues and notifiers across multiple while loops is one of the things that they were meant for. The loops don't even have to reside in the same vi's.

Putnam Monroe
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 5
(3,241 Views)
Hwy,

thanks for the reply.

I'm still new to Labview so can't really get my head round what you are describing sorry.

Cheers,
Michael
0 Kudos
Message 3 of 5
(3,229 Views)
In LV, a node (that would be a VI, function, loop, sequnce structure and so on) will only execute when all of its inputs have been "filled". That means if you have a wire coming out of one loop and going into another, the second loop won't execute until the first one has stopped, because the wire won't transfer the data until the first loop has stopped. If you turn on Highlight execution (the light bulb button), you can see where the code is running in slow motion. LabVIEW is not a DVD. It is a complex environment and to learn how it works you should start by reading the LV user manual. I also suggest you try searching this site and google for LabVIEW tutorials. Here is one you can start with. You can also contact your local NI office and join one of their courses.

___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,223 Views)
Here is a picture of my vi with a queue going to 3 places in the program. Two put data in the queue and one reads data out.
0 Kudos
Message 5 of 5
(3,216 Views)