annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

event driven state machine

Dear
 
 
Recently, I studied about design patterns.
Event driven state machine (http://zone.ni.com/devzone/cda/tut/p/id/2962) is the combination of state machine and event structure.
LabView Style book by P. Blume also explained about this.
 
In order to receive some event in the event driven state machine, ideally, LabView should monitor some idle state (inside while loop) without any delay time.
That is, some infinite loop should be run.
Is the event driven state machine useful in real programming?
0 Kudos
Messaggio 1 di 7
4.345Visualizzazioni
Sorry,

I don't understand the reason behind your post.

You write "ideally, LabView should monitor some idle state (inside while loop) without any delay time."  Is this a statement or a question.  If it's a question the answer is no.  If it's a statement it's wrong AFAIK.

The "activation" of the event structure works on Interrupts I think.  IT does not need to loop in an idle state, this is the whole idea behind the event structure.  It sleeps until it has something to do.

And yes, it's very useful for any kind of decent UI.  Even in "real programming".

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Messaggio 2 di 7
4.342Visualizzazioni
the event stucture in the event-driven-state-machine(edsm) will be inside case routine.
Therefore, while loop should be run every time.
 
Contrary to this, event structure only will sleep until UI event is fired.
 
If so, edsm is a kind of some infinite loop which is not recommended in LV programming.
 
Am I right?
0 Kudos
Messaggio 3 di 7
4.337Visualizzazioni
No you are wrong. Look at the examples in Blume's book for instance and you will see that the structure is a "wait until" not a "loop until".
0 Kudos
Messaggio 4 di 7
4.326Visualizzazioni
Dear  drval
 
Would you please explain me wait until and loop until?
I can't find them.
0 Kudos
Messaggio 5 di 7
4.313Visualizzazioni
Hi labmaster,

"wait until" and "loop until" are no LV functions, drval just gave you a description how the edsm will work.
The event structure "waits until" an event happens, so the state machine doesn't has to iterate all the time!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Messaggio 6 di 7
4.311Visualizzazioni
Dear,
 
I see what you mean.
I knew wait until is not function, but I became aware what you meam after seeing the event structure again.
 
Thanks alot.
 
 
0 Kudos
Messaggio 7 di 7
4.305Visualizzazioni