LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Driven State Structure

Hello all,

 

I'm in need of using this type of architecture. I was watching this two different videos, explaining Even State Driven programming. There is a slight difference but the results, apparently are the same. I think in my opinion configuration #1 is more suitable due to the fact that  you can still use the space of the CASE and the EVENT CASES. But If someone has a different point of view, or if I'm missing something, please help me out, I would really appreciate it.

 

José Luna

0 Kudos
Message 1 of 3
(2,845 Views)

Typically the event case is in "The Idle" state of an event driven state machine. For a good example look at the JKI State machine, you can install via VIPM.

 

The reasoning is as follows: When idle the stae machine can respond to events on the front panel and go to the appropriate state.

 

So in your example #2 is the best but still needs work. It is hard to tell from the pictures. So in number 2 would be as follows, nothing happens the state machine goes into the idle state, after a timeout in the idle state it then goes to the "Update Time" state. Right now you are updating in the timeout event in the idle state.

 

Hopefully this makes sense.

 

cheers,

mcduff

0 Kudos
Message 2 of 3
(2,827 Views)

Mike Porter has a blog post about how he handles state machines like your option #1.  I honestly tried it with a program and found that it often disrupted the order of states I needed.  So I switched it back to your option #2.  Again, I had a specific order that things had to happen, but left a part in the state order for checking for events (Idle with a timeout).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,819 Views)