User Tools

Site Tools


code:dqmh:state-machine:better-practices

04 Better Practises

Some general guidelines we found useful working with state machines:

  • Do not put “real code” inside the state machine, instead trigger a MHL-case
  • Public requests should always go through the MHL
    • Exception: When no data is needed for an action, public requests could directly request a transition from the EHL
  • Public requests should always go through the state machine
    • Exception: When they don't trigger some action, e.g. only ask the module for its status, read some values from the shift register etc.
  • All data needed is held in the shift register of the MHL

Transitions

  • Place transitions where events occur - don’t go through MHL or EHL “just because”
  • Transitions should not be triggered from within the state machine itself
  • Transitions can be called via public requests if the SM module is designed that way
  • Use the variant input of SM Request Transition.vi only for error information
code/dqmh/state-machine/better-practices.txt · Last modified: 2025/01/16 10:28 by joerg.hampel