Statemachine Node

The Statemachine node contains the following options:

Outline Generated Methods (may be changed locally)

If identical code is required for different transitions out of the same hierarchy state, a separate method is created (Outlining) for this code under certain conditions. This method is called wherever required.

If you do not want to create separate methods and method calls, deactivate the option. In that case, the action code is inserted directly wherever required.

Auto-inline private methods (smaller code-size – may be changed locally)

If small private functions (or functions with a low number of callers) are inlined, both code size and runtime are saved.

If the option is activated, the code generator recognizes such functions automatically and directs the compiler to inline them.

Hierarchical Code-Generation (may be changed locally)

Code for state machines can be generated either flat (one switch statement with a case expression for each state) or hierarchical (nested switch statements according to the state hierarchy). Flat code generation (deactivated) optimizes for runtime, hierarchical code generation (activated) optimizes for code size.

Initialize history variable with zero

If the option is activated, the history variables of hierarchy states in the project are initialized with 0 instead of the respective start state.

This causes an additional assignment in the code and may violate the MISRAClosed Motor Industry Software Association rules 16.4 and 16.5.

See also

State Machines – Optimizing the State Machine