07-27-2012 12:00 PM
Hi All,
Administrative/recording keeping question here. I have an Events Structure in a state machine with 27 separate events possible. How do people usually flow chart this?
Thanks,
FB
07-29-2012 02:52 PM
07-30-2012 08:07 AM
I would recommend a UML sequence diagram to document how an event structure works in your code. A companion state diagram would also help. You will need one sequence diagram for each state of the state diagram and event in your event structure (some of these can be combined, at your option). If you are unfamiliar with UML, check out UML Distilled, by Fowler and Scott. You can probably find a copy in the local library. It is a fast read.
As an aside, most LabVIEW state machines are actually task handlers. They conflate the ideas of state and task. In a well designed program, there are three elements - commands, states, and tasks. Commands generate tasks based on state. In a GUI based LabVIEW program, the event structure generates commands. These are converted to tasks based on the current state. For example, with a data acquistion program, clicking the Stop button while in the RUN state will stop the acquisition, read the current data, display it, and close the device handle. Clicking the Stop button in the STOPPED state will do nothing.