logo

Finite State Machines - Make light work of complex functions

State Diagrams 1, the wait loop

Flow chart representation of a state The type of programs we are talking about here are reactive programs. They are programs that react to events with apropriate responses.
 
The conceptually simplest way to make a program react to an expected event, say an input turning on, is to have it sit in a program loop waiting for the event to happen. We call this a wait loop. In an old fashioned flow chart format the wait loop is drawn as shown in figure 1Enable Javascript to see the pop-up.
 
You read this little diagram as "The program will get to this point. Then it will sit and wait until the input comes on, then it will continue".
Note: Figure 1 is not a state diagram. It is a snippet of an older form of diagram called a flow chart. I am starting with that because a lot of people already know flowcharts.
 

Sign up for our aperiodic newsletter for more tips, comments and generally interesting stuff related to controls.
Low propaganda index (promise!), highly digestible. Newsletter archive.

Copyright © 1996-2011 SPLat Controls Pty Ltd