LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FOR loop pause based on events (UI and non-UI)

Solved!
Go to solution

@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.....

0 Kudos
Message 11 of 16
(1,301 Views)

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

 

Download All
Message 12 of 16
(1,256 Views)

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

0 Kudos
Message 13 of 16
(1,228 Views)

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




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 14 of 16
(1,208 Views)

@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>   ---'


0 Kudos
Message 15 of 16
(1,199 Views)

thanks to all. At the end I decided to build a queue state machine but instead of queue using just Notifiers.

0 Kudos
Message 16 of 16
(1,087 Views)