07-30-2013 08:20 AM - edited 07-30-2013 08:21 AM
Hello I have realized this trafficlight with the purpose to do some practice with labview.
Could this be considered as a State Machines in the way it is thought? It works 3 times doing Green->Yellow+Red-->Red-->Red+Yellow-->Green and so on.
Can you suggest me other implementations?
Thank you
07-30-2013 08:33 AM
This is no state machine. This is a static sequence which is repeated several times.
The issues with such approach are:
- How do you terminate prematurely as such that the program can shut down gracefully?
- How flexible is the code if you have to change order of execution?
- How readable will the code be if you add 1, 2, .., 10, ...100 new "cases"?
You should use a real state machine. You can find an example in the LV template browser which you open by selecting File >> New.
(NOT New VI!)
hope this helps,
Norbert
PS: Do not use variables.
07-30-2013 08:46 AM
Here some WhitePapers talking about StateMachine Design and giving some examples (Step by step):
07-30-2013 08:57 AM
mmm ok i'll read the two files linked down and i'll try again.