Sequential Function Chart (SFC+)

The SFC+ (Sequential Function Chart, + because enhanced from SFC) is a graphical representation of sequential, parallel and alternative behaviors for a block program.

SFC + Elements

Basic elements of the SFC+ are steps. A step has associated actions and transitions. A transition has associated conditions.

An SFC+ is composed of a set of steps. At a given cycle, a step is active or inactive, the activity status of all the steps describes the state of the whole system. Each SFC+ has a unique initial step: it represents the entry point of the SFC+ and it is active at the very first cycle when the block is run.

At each cycle, active steps are scanned, their associated actions are executed, their direct following transitions are evaluated, and steps following enabled transitions are set active, with respect to the transition property.

Here is a description of SFC+ elements:

Step

At a given cycle, a step is active or inactive.

The set of active steps represents the status of the SFC+ program for a given cycle.

Initial Step

An SFC+ program has one and only one initial step.

It represents the entry point of the SFC+ and it is active at the very first cycle. The initial step of an SFC+ may have actions associated to.

Action

There exists four types of actions: Pulse, Sustain, Macro and Run.


  • Pulse: the action is performed only the first cycle the step is active
  • Sustain: the action is performed each cycle the step is active
  • Macro: this action triggers an SFC+
  • Run: the action runs a block instance

Transition

A transition links two steps.

When no condition is specified with the transition, the default value is "true".

Condition

A condition must be true to execute the next step.

Alternative Branches

You can define alternative behavior.

Starting from one step, different evolutions of the SFC+ can be defined. Several transitions can be linked from one step: they are called alternative branches.All conditions of all alternative branches are evaluated, taking priorities and transition types into account (see next section).

Priority on transitions have to be defined within the construction of the SFC+ because some conditions of alternative branches can be true together at evaluation cycle. The lowest number has the highest priority.

Transitions

The transition flag defines when the transition must be evaluated, when the previous step is killed, when the next step is executed.

The Activation Flag says when the transition is evaluated

  • Immediate: the transition is evaluated the first cycle the source step is active. Graphically, this is a continuous line before the pre-emption flag.
  • Delayed: the transition is evaluated the second cycle the source step is active. (This insures that actions of the source step are executed at least during one cycle before clearing the transition). This is graphically represented by a blank space before the pre-emption flag.

Note: the difference in behavior between these 2 flags stands only the first cycle the source step is active.

The Pre-emption Flag says how are killed actions of the source step, once the transition condition is true

  • Lazy: actions are active for the current cycle, and killed next step. Its graphic representation is an horizontal line.
  • Urgent: the source step is deactivated and its actions killed right away. This is an horizontal flash.
  • Join: the transition is cleared when all SFC+ sons of the source step have reached their final step. Its graphic representation is a vertical arrow.

Delay Flag defines when the transition is cleared:

  • Now: the target step is activated the same cycle the transition condition is true. Graphically, this is a continuous line after the pre-emption flag.
  • Next: the target step is activated one cycle after the condition is true. This is represented by a blank space after the pre-emption flag.

The default transition is Immediate Lazy Next.

Below are two examples of flag combination:

Note: Note: A continuous line in the graph determines what is computed within one cycle.

LCM Constructiveness and Acyclic Condition: Consequences on SFC+ Design

The compilation of an SFC graph can fail if a causality error or an instananeous loop are detected.

Causality

A causality error existis if a signal, in the same cycle, is read before being written. From the user point of view, it is quite easy to know when the constructiveness rule is bypassed, because the compiler detects and indicates unconstructive SFC+ areas. An SFC+ area delimits what is computed in one cycle. Considering the formalism used in SFC+, what is computed in one cycle is drawn with a plain line.


  • The SFC+ below is causal because the signal B is emitted before being tested:

  • The following SFC+ will not be accepted by the compiler, because the signal B is read before it is written within the same cycle:

  • One way to correct the previous graph is to add a pause, changing the flag of the transition:

Instantaneous Loop

A loop is instantaneous if there is no pause defined.

Here is an example of an instantaneous loop in SFC+