SFC Main Format
A Sequential Function Chart (SFC) program is a graphic set of steps and transitions, linked together using oriented links. Divergences and convergences represent multiple connection links from 1 to n and n to 1 respectively. The basic graphic rules of SFC are:
- SFC programs must have at least one initial step
- A step must follow a transition
- A transition must follow a step
SFC programs describe sequential operations, where the time variable explicitly synchronizes basic operations. These are called sequential programs. Programs before and after SFC programs describe cyclic operations and are not time-dependent. These are called cyclic programs. Main sequential programs (at the top of the hierarchy) are executed according to the SFC dynamic behavior. Cyclic programs are systematically executed at the beginning of each run time cycle. In Programs sections, sequential programs are grouped together.
Main sequential programs are described with the SFC language; cyclic programs cannot be described with the SFC language. Any SFC program can have one or more SFC child programs.
Functions and function blocks can be called from actions or conditions of SFC programs.
SFC programs and SFC child programs have dynamic behavior limits which are set at the controller level. These dynamic behavior limits determine the amount of memory, allocated by a target at initialization time, designated to manage SFC dynamic behavior (for example, token moving). The amount of allocated memory is calculated as a linear relation with the number of SFC POUs:
Alloc Mem (bytes) = N * NbElmt * sizeof(typVa)
NbElmt = GainFactor * NbOfSFC + OffsetFactor
Where:
N = 5 (constant linked to SFC engine design)
NbElmt = The maximum number of valid transitions for each executed cycle, for example, transitions with at least one of their previous steps being active.
typVa = 16 bits in the medium memory model (32 bits in the large memory model)
GainFactor and OffsetFactor = the linear parameters of the linear relation
NbOfSFC = the number of SFC POUs in the project
Factor of dynamic behavior limits determining the amount of memory, allocated by a target at initialization time, designated to manage token moving. The amount of allocated memory is calculated as a linear relation with the number of SFC POUs:
Alloc Mem (bytes) = N * NbElmt * sizeof(typVa)
NbElmt = GainFactor * NbOfSFC + OffsetFactor
These points offer a simplified and more approximate definition of the allocated memory:
- The maximum number of steps that can be active
- The maximum number of actions (N, P1 or P0 action linked to the step) that can be executed
When the available memory is insufficient at a specific moment for a target where check mode (ITGTDEF_SFCEVOCHECK defined in dsys0def.h) is generated, the target kernel generates a warning. This warning signals an SFC token moving error or an action execution error and the controller is set to ERROR mode where cycles are no longer executed or kernel behavior may become unpredictable.
For SFC function blocks and SFC child function blocks, each has a maximum number of tokens which is set in the properties of the block.
SFC function block instances, as their SFC child blocks, have a maximum number of tokens, unlike SFC programs whose dynamic behavior limits are set at the controller level.
Provide Feedback