02-15-2017 05:12 PM
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
02-15-2017 05:46 PM
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
02-15-2017 05:59 PM
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).