Difference between revisions of "State Icon Properties"

From Flowcode Help
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
===State Icon===
 
 
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.
 
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.
  
Line 22: Line 21:
  
 
Only one transition can exit this entry state and neither this transition nor the entry state can be deleted from the state diagram.
 
Only one transition can exit this entry state and neither this transition nor the entry state can be deleted from the state diagram.
 
 
An Exit State is a special type of state icon that is used to leave the macro and return to the macro that called this macro.
 
 
 
During simulation or when using ICD, the state will be drawn with a thick orange outline when it is executing and when its exit transitions are being evaluated. 
 
 
First, the state function, if it exists, will be executed. 
 
 
Next, the transitions will be evaluated and the first one with a true condition is drawn in orange with other transitions (even if they are true) drawn in blue. 
 
 
The program will then execute this first true transition. 
 
 
If all transitions leaving the state are false, then they will all be shown as blue and the state with be executed again.
 

Latest revision as of 11:08, 4 April 2023

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.


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.


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.


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.