State Icon Properties

From Flowcode Help
Jump to navigationJump to search

IconState.png

A State icon is used within a State Diagram macro to represent one of the states. Each State icon will have optional functionality that is executed when the State is entered.


Details

IconState.png Properties State.png

A State Diagram consists of several state icons interconnected with transitions. Like a transition, a state icon has a display name (i.e. the text displayed on the state within the diagram) and an optional function.


Display Name

The name of the icon that appears in the State icon in the State Diagram.

This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.


Function

The function is code that is executed when the program flow enters (or remains in) that state icon.

This can be to call a macro, perform a calculation, delay program execution or execute some custom C code.


States will perform their optional function when program flow enters that state through a transition from another state.


This can be optionally displayed or hidden on the icon itself when the "Show" tick-box is unticked.


Set transition order

States usually have one or more exit transitions: arrows that flow out of the state icon with optional conditions that must be true for program execution to ‘flow’ along that Transition.

These exit Transitions are evaluated in turn until one is found to be true. The evaluation order of these transitions can be set by clicking “Set transition order” or by reconnecting the start end of the transition to the state.

TransitionOrder.png

Special States

A state without an exit transition will force program execution to remain in that state until the program is stopped by the user.


Each state diagram must contain a single “Entry State” icon which contains the code to be executed when the program enters that macro.

Only one transition can exit this entry state and neither this transition nor the entry state can be deleted from the state diagram.


State Diagrams can may have one or more Exit State icons, which cause the State Diagram to return to its calling macro.

These may have a return value if this State Diagram macro specifies a return type.