08-19-2015 02:12 AM
@dkfire wrote:
Or this original thread:
http://forums.ni.com/t5/LabVIEW/Notifier-for-loop/m-p/3179244?lang=en
Hi there,
that other thread was thinking on using strictly notifiers, and had no more ideas to the design, until I get an solution with Notifiers in that thread, I think then I will close it.....
08-19-2015 05:05 AM
Hello Starosyst,
attached is an example from a state machine with an event structure in the idle state. The state machine starts with idle, and waits until somebody presses the Go to state 1, 2 or exit button. When you go to state 1 or 2 I added a 1 sec delay just so we can see what is happening.
Hope this helps,
Bets regards,
Martijn
08-19-2015 08:19 AM
Why not take advantage of LabVIEW's "inherently-parallel" nature? The Producer/Consumer pattern is ideal for a Queue-driven State Machine, with the Producer being the Event Loop which sits there, waiting for an Event, and when one comes (as the result of a Button Push), puts the corresponding State on the Queue and hands it to the Consumer Loop, the State Machine (with no more need for an Idle State, unless you truly want to do some Idle processing such as creating a pleasing display with Front Panel Indicator lights). You can learn more about the Producer/Consumer pattern by creating a new VI from the Producer/Consumer Template (File, New ... (the three dots are important!), From Template, Frameworks, Design Patterns, Producer/Consumer Design Pattern (Events)).
Bob Schor
08-19-2015 08:46 AM
This is exactly what I suggested in his other duplicate thread here: http://forums.ni.com/t5/LabVIEW/FOR-loop-pause-based-on-events-UI-and-non-UI/m-p/3179778#U3179778
08-19-2015 08:55 AM
@Joe_H wrote:
This is exactly what I suggested in his other duplicate thread here: http://forums.ni.com/t5/LabVIEW/FOR-loop-pause-based-on-events-UI-and-non-UI/m-p/3179778#U3179778
Heh, you linked to this thread. An infinite loop has been create.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-11-2015 02:50 AM
thanks to all. At the end I decided to build a queue state machine but instead of queue using just Notifiers.