Reference Design Content

Showing results for 
Search instead for 
Did you mean: 

Event Driven Queued State Machine (EDQSM)

Producer-consumer based actor design pattern backed by a Mealy state machine. Implements Behavior Driven Development (BDD) Given-When-Then scenarios directly in the code and enforces the code to be written in that way to be easily testable.


Key features beyond keeping the same structure and plumbing code regardless of the functionality of a particular actor:

  • Separation of notions of events, states, and actions
  • Separate queues for events and actions to facilitate Run To Completion scheduling
  • State machine implementation where actions can be associated not only with entering a state but also with transitions between states (Mealy state machine)
  • Isolation in a dedicated place in the code of the high level state machine ("business") logic: in which state ("Given") on which event ("When") to run which actions and switch to which next state ("Then"). This is worse than storing that information as a separate data structure and maybe even in a separate file editable with a specialized editor like it was done in my LabHSM toolkit but still much better than branching depending on the state in the actions themselves.


The original LAVA thread (2006!):


The code saved in LabVIEW 2016 is attached.