LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flowcharting an Events Structure

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

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 1 of 3
(2,135 Views)

Hi FB,

 

I would "flow chart" it the same way as a case structure with 27 cases...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,104 Views)

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.

Message 3 of 3
(2,070 Views)