You are on page 1of 0

SEQUENTIAL

FUNCTION CHART
Workshop Users Guide


Famic Technologies Inc.
9999 Cavendish Blvd., Suite 350, St-Laurent, QC, Canada, H4M 2X5
Tel.: 514-748-8050, Fax: 514-748-7169, Url: www.automationstudio.com
FAMIC

Technologies Inc.
All rights reserved.

Users Guide for the SFC Workshop, Automation Studio.
Document Number: AS5-GUI-EF02-001
REPRODUCTION
Reproduction or re-transmission of this manual or software, in whole or in part, by any
means, is strictly prohibited without the express written consent of FAMIC


Technologies Inc.

IBM is a registered trademark of IBM Corporation.
Windows is a registered trademark of Microsoft Corp.
PNEUSIM is a registered trademark of FAMIC Inc.
AUTOMATION STUDIO is a registered trademark of FAMIC Technologies Inc.

i
Table of content
1. Introduction...................................................................................................................1-1
1.1. About the SFC Workshop ....................................................................................1-1
2. Description of the SFC Editors Menus.......................................................................2-1
2.1. Edit Menu.............................................................................................................2-2
2.1.1. Options from the Component Properties Command in the Edit
Menu........................................................................................................2-3
2.1.2. Options from the Properties Command in the Edit Menu........................2-3
2.2. SFC Menu.............................................................................................................2-7
2.3. The SFC Toolbar ..................................................................................................2-9
3. Creating an SFC............................................................................................................3-1
3.1. Creating a Project and an SFC..............................................................................3-1
3.2. Introduction to the SFC in Automation Studio.....................................................3-2
3.3. Graphical Representation .....................................................................................3-3
3.4. Description of SFC Components..........................................................................3-4
3.5. Description of the Circuit to Build .......................................................................3-5
3.6. Building the SFC..................................................................................................3-7
3.6.1. Inserting the Steps....................................................................................3-8
3.6.2. Inserting Transitions...............................................................................3-14
3.6.3. Defining Actions ....................................................................................3-19
3.6.4. Inserting Links Between Components ...................................................3-20
3.6.5. AND Link ..............................................................................................3-20
3.6.6. OR Link..................................................................................................3-23
3.6.7. Inserting Structured Texts ......................................................................3-25
3.6.8. Inserting Comments ...............................................................................3-28
3.7. Error Prevention .................................................................................................3-30
4. SFC Syntax.....................................................................................................................4-1
4.1. Introduction ..........................................................................................................4-1
SFC Users Manual
ii
4.2. Identifier Nomenclature....................................................................................... 4-2
4.2.1. Steps ........................................................................................................ 4-2
4.2.2. Transition................................................................................................. 4-3
4.2.3. Structured Text ........................................................................................ 4-4
4.2.4. Comments................................................................................................ 4-4
4.2.5. Reserved Keywords................................................................................. 4-4
4.3. Variables .............................................................................................................. 4-5
4.3.1. Variable Types ........................................................................................ 4-5
4.3.2. Creating Variables................................................................................... 4-5
4.3.3. Creating External Links on Variables ..................................................... 4-6
4.4. Constants.............................................................................................................. 4-6
4.5. Basic Arithmetic Expression Operators............................................................... 4-6
4.6. Advanced Mathematical Expression Operators................................................... 4-6
4.7. Boolean Expression Operators........................................................................... 4-10
4.8. Edge Operators .................................................................................................. 4-11
4.9. Relational Operators .......................................................................................... 4-12
4.10. Operator Priority................................................................................................ 4-12
4.11. Assignment operators......................................................................................... 4-13
4.11.1. Continuous Boolean Assignment .......................................................... 4-13
4.11.2. Numeric Assignment ............................................................................. 4-14
4.11.3. Conditional Boolean Assignment.......................................................... 4-14
4.11.4. Conditional Numerical Assignment ...................................................... 4-15
4.11.5. Stored Boolean Assignment .................................................................. 4-15
4.12. Syntax Error Prevention..................................................................................... 4-16
4.13. Example of a Step Action .................................................................................. 4-17
4.14. Example of Transition........................................................................................ 4-18
4.15. Structured Text .................................................................................................. 4-18
4.16. Comments .......................................................................................................... 4-19
4.17. Timers ................................................................................................................ 4-19
4.17.1. Timer On-delay ..................................................................................... 4-20
4.17.2. Off-Delay Timer.................................................................................... 4-22
Table of content
iii
4.17.3. Pulse Timer ............................................................................................4-22
4.17.4. Step Timer..............................................................................................4-23
4.18. Managing SFC States and Faults........................................................................4-24
4.18.1. Managing SFC States.............................................................................4-25
4.18.2. Managing SFC Faults.............................................................................4-26
4.19. Macro Steps ........................................................................................................4-28
4.20. Hierarchical Forcing...........................................................................................4-29
4.20.1. Using Hierarchical Forcing....................................................................4-29
4.20.2. Rules on Hierarchical Forcing ...............................................................4-30
5. Simulation ......................................................................................................................5-1
5.1. State of an SFC During Simulation ......................................................................5-1
5.2. Step and Transition States During Simulation......................................................5-2
5.3. Fault Management During Simulation .................................................................5-4
5.3.1. Sequence Duration Surveillance ..............................................................5-4
5.3.2. Step Duration Surveillance ......................................................................5-6
5.3.3. General Fault............................................................................................5-9
5.4. Windows Layout ................................................................................................5-10
5.5. Project Simulation ..............................................................................................5-10
5.5.1. Operator's Intervention...........................................................................5-11
5.5.2. Simulation of the SFC_PNEU_EN.PR4 or
SFC_HYDRO_EN.PR4 Projects ...........................................................5-12
5.6. Possible Causes of Problems ..............................................................................5-12
5.6.1. Structure Errors ......................................................................................5-12
5.6.2. Syntax Errors..........................................................................................5-15
6. Exercises.........................................................................................................................6-1
6.1. Exercise 1 Command Circuit of a Drilling Machine .........................................6-1
6.1.1. Description of the Operative Part of the Circuit.......................................6-2
6.1.2. SFC...........................................................................................................6-2
6.2. Exercise 2 Command Circuit of the Drilling Unit .............................................6-4
6.2.1. Description of the Operative Section .......................................................6-5
6.2.2. Description of the Wired Command Circuit ..........................................6-10
SFC Users Manual
iv
6.2.3. SFC........................................................................................................ 6-20
6.2.4. Simulation ............................................................................................. 6-33
A. Glossary.........................................................................................................................A-1
B. Index .............................................................................................................................. B-1


v
List of figures
Figure 21: SFC Editors main window.................................................................................2-1
Figure 22: Edit menu............................................................................................................2-2
Figure 23: Options from the Select command in the Edit menu...........................................2-2
Figure 24: Document Properties dialog box; SFC branch....................................................2-4
Figure 25: Sequence Time Supervision dialog box..............................................................2-4
Figure 26: Commands from the SFC menu..........................................................................2-7
Figure 27: Options in the Links and Branches option from the SFC menu..........................2-7
Figure 28: Options from the Insert command in the SFC menu...........................................2-8
Figure 29: SFC toolbar .........................................................................................................2-9
Figure 31: Document Properties dialog box.........................................................................3-2
Figure 32: SFC example.......................................................................................................3-3
Figure 33: Electrical and pneumatic circuit..........................................................................3-6
Figure 34: SFC .....................................................................................................................3-7
Figure 35: Step component symbol ......................................................................................3-8
Figure 36: Modification of the step type ..............................................................................3-8
Figure 37: Step Properties dialog box ..................................................................................3-9
Figure 38: Step Time Supervision dialog box......................................................................3-9
Figure 39: Step Guided Mode dialog box ..........................................................................3-12
Figure 310: Upstream Transitions dialog box ....................................................................3-14
Figure 311: Downstream Transitions dialog box ...............................................................3-14
Figure 312: Transition symbol ...........................................................................................3-14
Figure 313: Transition Properties dialog box.....................................................................3-15
Figure 314: Transition Guided Mode dialog box ...............................................................3-17
Figure 315: Upstream Steps dialog box .............................................................................3-18
Figure 316: Downstream Steps dialog box.........................................................................3-18
SFC Users Manual
vi
Figure 317: Inserting Transition 1 ..................................................................................... 3-19
Figure 318: Defining an action.......................................................................................... 3-20
Figure 319: Transition 2, step 3 and transition 3 ............................................................... 3-20
Figure 320: Steps prior to an AND divergence ................................................................. 3-21
Figure 321: Steps following the creation of the AND divergence..................................... 3-22
Figure 322: SFC after having inserted an AND convergence ........................................... 3-22
Figure 323: SFC prior to inserting an OR convergence .................................................... 3-23
Figure 324: SFC after the insertion of an OR convergence............................................... 3-25
Figure 325: Example of a Structured text .......................................................................... 3-25
Figure 326: SFC after inserting a structured text............................................................... 3-26
Figure 327: Structured Text Properties dialog box............................................................ 3-27
Figure 328: Example of a comment................................................................................... 3-28
Figure 329: SFC after inserting a comment ....................................................................... 3-29
Figure 330: Comment Properties dialog box..................................................................... 3-29
Figure 331: Messages window .......................................................................................... 3-30
Figure 41: Inserting a step ................................................................................................... 4-2
Figure 42: Inserting a transition........................................................................................... 4-3
Figure 43: Inserting a structured text ................................................................................... 4-4
Figure 44: Inserting a comment ........................................................................................... 4-4
Figure 45: Timing diagram of an action using a rising edge operator ............................... 4-11
Figure 46: Continuous Boolean assignment in an action................................................... 4-13
Figure 47: Numeric assignment ......................................................................................... 4-14
Figure 48: Conditional Boolean assignment...................................................................... 4-14
Figure 49: Conditional numerical assignment ................................................................... 4-15
Figure 410: Stored assignment .......................................................................................... 4-15
Figure 411: Options dialog box, SFC Module branch....................................................... 4-16
Figure 412: Configuration dialog box, Kernel branch....................................................... 4-17
Figure 413: Example of a step action ................................................................................ 4-18
List of figures
vii
Figure 414: Transition condition........................................................................................4-18
Figure 415: Structured texts: order of execution................................................................4-19
Figure 416: Comments .......................................................................................................4-19
Figure 417 : Timer on-delay...............................................................................................4-20
Figure 418: On-delay timer timing chart ............................................................................4-21
Figure 419: Delayed assignments.......................................................................................4-21
Figure 420: Time-limited assignment.................................................................................4-22
Figure 421: Off-delay timer time chart...............................................................................4-22
Figure 422: Impulse timer time chart .................................................................................4-23
Figure 423: Step timer time chart X1.T..............................................................................4-23
Figure 424: Using step timer: X1.T....................................................................................4-24
Figure 425: SFC input and output variables.......................................................................4-25
Figure 426: Using macro steps ...........................................................................................4-28
Figure 427: Forcing............................................................................................................4-29
Figure 428: Conditional forcing .........................................................................................4-30
Figure 429: Forcing to an empty situation..........................................................................4-30
Figure 430: Legal forcing...................................................................................................4-31
Figure 431: Illegal forcing..................................................................................................4-31
Figure 51: An SFC's states during simulation ......................................................................5-1
Figure 52: Initial step in an active state................................................................................5-2
Figure 53: Forced active step ...............................................................................................5-2
Figure 54: Active macro step................................................................................................5-2
Figure 55: Active entry step .................................................................................................5-2
Figure 56: An active exit step...............................................................................................5-3
Figure 57: Step with break point and locked number...........................................................5-3
Figure 58: Transition that can be validated during simulation .............................................5-3
Figure 59: Window layout..................................................................................................5-10
Figure 510: Example of a forced NO push button..............................................................5-11
SFC Users Manual
viii
Figure 511: Rule 5 of SFC................................................................................................. 5-13
Figure 512: Rule 5 of SFC (cont'd).................................................................................... 5-14
Figure 513: Rule 5 of SFC (cont'd).................................................................................... 5-14
Figure 61: Command circuit and SFC of a drilling machine............................................... 6-1
Figure 62: Drilling unit ........................................................................................................ 6-4
Figure 63: Feeder unit.......................................................................................................... 6-6
Figure 64: Brace and drilling unit........................................................................................ 6-7
Figure 65: Test and evacuation unit of the drilling cell ....................................................... 6-8
Figure 66: Indexing of the bracing plate.............................................................................. 6-9
Figure 67: Control panel .................................................................................................... 6-10
Figure 68: Operative command schematics ....................................................................... 6-17
Figure 69: Operative command schematics (cont'd).......................................................... 6-18
Figure 610: Signalization command schematics................................................................ 6-19
Figure 611: Signalization command diagram.................................................................... 6-20
Figure 612: Hierarchy structure of the SFCs in the automatism........................................ 6-21
Figure 613: Hierarchical structure of the SFCs in the automatism.................................... 6-22
Figure 614: DEFAIL SFC, system fault processing .......................................................... 6-23
Figure 615: DEFAIL SFC, initialisation command of the SFCs ....................................... 6-24
Figure 616: DEFAIL SFC, start command of the SFCs .................................................... 6-25
Figure 617: START_STOP SFC ....................................................................................... 6-26
Figure 618: START_UP SFC............................................................................................ 6-27
Figure 619: Mechanical initialisation SFC INIT_MEC..................................................... 6-28
Figure 620: NORMAL operation SFC .............................................................................. 6-29
Figure 621: FEEDER macro step SFC .............................................................................. 6-30
Figure 622: DRILL macro step SFC.................................................................................. 6-31
Figure 623: EVAC macro step SFC................................................................................... 6-32
Figure 624: SHUTDOWN SFC......................................................................................... 6-33


1-1
1. Introduction
This sequential function chart (SFC) workshop Users Guide provides the information
required to use this workshop with Automation Studio. This includes technical specifications
for components, procedures for defining properties, the building and simulation of a circuit,
and examples of applications.
Automation Studio is a modular simulation software package to which various simulation
modules can be plugged in.
Each module, called a workshop, contains a library from which you can withdraw
components to create different types of circuits SFC, electrical diagram, and others either
alone or combined.
The Automation Studio handles the following functions: editing, simulation, file and diagram
management, printing, and display.
1.1. About the SFC Workshop
The SFC workshop is a direct manipulation graphic editing tool as well as a (SFC) simulation
tool. The notation used conforms to the CEI 61131-3 International Standard and to the
extension proposals as defined by the AFCETs SFC group and by the PR NF EN 60848
standard project.

2-1
2. Description of the SFC Editors Menus
This chapter covers the menus in the SFC Editor and those not included in the Users Guide.
For a description of items with functionality common to all workshops, refer to the Users
Guide.


Figure 21: SFC Editors main window
SFC Users Manual
2-2
2.1. Edit Menu

Figure 22: Edit menu
The SFC Editors Edit menu options are as follows:
Select
Allows the user to select every step, transition, structured text, comment, link, all that follows
a selected transition/step, and every item of an SFC.
The options available from the Select command in the Edit menu are as follows:

Figure 23: Options from the Select command in the Edit menu
All Steps: Selects all the steps.
All Transitions: Selects all the transitions.
All Structured Texts: Selects all the structured texts.
All comments: Selects all the comments.
Description of the SFC Editors Menus
2-3
All Links: Selects all the links.
Follow: Selects all that follows a selected transition/step, including the selected item.
All: Selects all the items of an SFC.
Component Properties
Allows the user to access the properties of the selected component. See Building the SFC
section.
Document Properties
Allows the user to access the document properties: Page Setup, Information Summary, SFC,
and History.
2.1.1. Options from the Component Properties
Command in the Edit Menu
This command provides access to the properties dialog box of the selected component SFC
component properties are described in the following sections. See Building the SFC section.
2.1.2. Options from the Properties Command in the Edit
Menu
This command provides access to the Document Properties dialog box. Properties of an SFC
document are grouped into four branches:
Page Setup;
Summary Information;
SFC;
History.
Page Setup, Summary Information, and History are similar for all documents in the software;
refer to the Users Guide for a complete description of these branches.
When this dialog is opened, the SFC branch is selected by default.
SFC Users Manual
2-4

Figure 24: Document Properties dialog box; SFC branch.

Figure 25: Sequence Time Supervision dialog box
The options available from the Document Properties dialog box are as follows:
Section Description
A Name The default SFC name is displayed in this zone. This field is
modifiable. It is synchronized with the name of the document that
appears in the Project Explorer.
B Hierarchic
Level
This zone allows the modification of the SFC hierarchic level. The
level is 0 by default (highest level). The hierarchic level must be in the
0 999
G
A
B
E D
C
F
G
H
I
J
Description of the SFC Editors Menus
2-5
Section Description
0 to 999 range.
C Class With the use of the drop-down list, to specify whether the SFC is an
explosion of a macro step or a standard SFC. The SFC is defined as
being STANDARD by default.
D Source Step The source macro step of the macro step SFC is defined in this zone.
E Unconditional
SFC Run
This checkbox, checked by default, allows an unconditional running
of the SFC.
If the checkbox is unchecked, a structured text must contain the SFC
execution condition. For example: SFC_Name.RUN IF CONDITION
F Comment Input a general comment for the SFC in this zone.
This button gives the user access to the Sequence Time Supervision
dialog box. The sequence time is calculated from the start to the return
to the initial step.

To use this function, the SFC must have only one initial step
that must be step 1.
Minimum Sequence Time It is possible, in this zone, to input a
minimum sequence time default. If the
sequence is active for a time lesser than
the time specified, the minimum
sequence time default will be set to
TRUE (ex.:
GRA_001.SEQ_MIN_FAULT)
G Time
Supervision
Maximum Sequence Time It is possible, in this zone, to input a
maximum sequence time default. If the
sequence is active for a time greater than
the time specified, the maximum
sequence time default will be set to
TRUE (For example:
GRA_001.SEQ_MAX_FAULT)
H Display Level Comments, Level 1 Displays the SFC components
comments (Level 1).
SFC Users Manual
2-6
Section Description
Statements (action,
condition), Level 2
Displays the SFC components
statements (action and condition) (Level
2).
Boolean Animation When this option is selected, the name
of the Boolean variables with a TRUE
condition is displayed in reverse video
during a simulation.
Numerical Animation When this option is selected, a field
containing the variables value is
displayed on the right of the numerical
variables name during a simulation.
I Simulation
Active Step Scrolling When this option is selected, the SFCs
are moved inside their own window in
order for the active steps to remain
visible on the screen. The display
priority is granted to the SFCs upper
left side steps. So, when two steps of a
single SFC are simultaneously active,
the top priority is granted to the one step
positioned in the furthest left and up of
the SFC.
Fit Vergences
Automatically
Adjusts AND and OR links based on the
shortest path between the step/transition
components.
Automatic Jump-to Label
on Rising Link
Automatically replaces rising links by
jumps in order to simplify SFCs.
J Options
Automatic Open Properties
Dialog Box
Automatically opens the properties
dialog box of the component (SFC, step,
transition, comment, or structured text)
when created.
Description of the SFC Editors Menus
2-7
2.2. SFC Menu
The commands available from the SFC menu are as follows:

Figure 26: Commands from the SFC menu
Links and Branches
Provides the user access to actions on links and branches (AND or OR
convergence/divergence).
The actions available from the Links and Branches command in the SFC menu are as follows:

Figure 27: Options in the Links and Branches option from the SFC menu
Base Fit Redraw: Redraws the selected link or branch based on the shortest path between
the components.
Adjust: Adjust selected vergence containing jumps to the shortest path.
Convert Link: Depending on the selected element, converts from either link to jump or
jump to link.
Convert Step
Converts a standard step into an initial step and vice versa.
Lock Number
Protects the selected item number from being renumbered.
SFC Users Manual
2-8
Unlock Number
Opens the selected item number to renumbering.
Renumber
Renumbers all selected unlocked items.
Insert
Grants the user access to the component insertion tool in the SFC. Components can be
inserted from the toolbar.
The options available from the Insert command in the SFC menu are as follows:

Figure 28: Options from the Insert command in the SFC menu
Initial Step: Inserts an initial step in the SFC.
Macro Step: Inserts a macro step in the SFC.
In Step: Inserts an in step in the macro defined SFC.
Out Step: Inserts an out step in the macro defined SFC.
Standard Step: Inserts a standard step in the SFC.
Transition: Inserts a transition in the SFC.
Alternate Step/Transition: Inserts an alternate standard step and a transition in an SFC.
Alternate Transition/Step: Inserts an alternate transition and a standard step in an SFC.
Structured Text: Inserts a structured text in the SFC.
Comment: Inserts comments in the SFC.
Description of the SFC Editors Menus
2-9
Errors
Allows identifying errors in the SFC. Error and/or warning messages are displayed in the
Messages Window (refer to the Message Window section of the Users Guide).
2.3. The SFC Toolbar
The SFC toolbar contains all the buttons that correspond to the most utilized commands from
the Project Explorer and Diagram Editor. The toolbar automatically adjusts itself to the
functioning utility. When the command is unavailable in the utility, the button is greyed out
and therefore inaccessible.



Figure 29: SFC toolbar
The tools available in the SFC toolbar are as follows:
Tool Description
A Selection Returns to the original arrow pointer.
B Initial Step Inserts an initial step.
C Macro step Inserts a macro step.
D In Step Inserts an in step in a macro defined SFC.
E Out Step Inserts an out step in a macro defined SFC.
F Standard Step Inserts a standard step.
G Transition Inserts a transition.
H Alternate
Step/Transition
Inserts an alternate standard step/transition.
I Alternate
Transition/Step
Inserts an alternate transition/standard step.
J Structured Text Inserts a structured text.
K Comment Inserts a comment.
C D F B E G H I J
A
K

3-1
3. Creating an SFC
This example is intended for you to familiarize yourself with the software commands. It uses
a step by step method that allows you to construct your first SFC.
3.1. Creating a Project and an SFC
To create a project containing SFCs, execute the following step:
1. Choose File New Project.

The Diagram Editor window displays the SFC management menus and commands. The
newly created window corresponds to a folder in the Project Explorer and containing the list
of diagrams and SFCs of this project.
To create a new SFC:
1 Choose File New SFC

The Sequential Function Chart Templates dialog box opens.
2. Select the template you require.

In this case, new templates have not been created, so the only choice you have is
None
3. Click OK.
The Document Properties dialog box containing the SFCs properties is displayed on the
screen.
4. For this SFC, enter GRA_001 in the Name field, the Hierarchy Level and Class fields
display 0 and Standard by default. Then in the Comments field, enter Creating a First
SFC.
5. Click on the Apply button to validate the changes.
6. Click on the Close button to shut the window and return to the diagram.
SFC Users Manual
3-2
The SFC Editor adds all the necessary commands to the menu and toolbars to create an SFC.
The status bar provides the related information when browsing the SFC.

Figure 31: Document Properties dialog box
3.2. Introduction to the SFC in Automation
Studio
Generally, an automated system is composed of two independent sections:
The Operative section: The physical process to be automated.
The Command section: The logical unit that outputs a series of commands destined for
the operative part or other exterior elements using various inputs.
An SFC is a graphic model using basic SFC components that represents an automated system.
SFC basic components are:
Steps, which are associated with actions;
Transitions, which are associated with transition conditions;
Creating an SFC
3-3
Structured texts that correspond to autonomous actions which are not associated with a
step;
Oriented links that connect steps and transitions.
3.3. Graphical Representation
The following figure represents a typical SFC using various basic SFC components.

Figure 32: SFC example
SFC Users Manual
3-4
3.4. Description of SFC Components
Name Symbol Description
Inactive Initial
Step

A double box identified by a number
represents an initial step.
Standard Step

The step input is always on top.
The step output is always on the bottom.
A box identified by a number represents a
standard step.
Actions are connected to their corresponding
step by a link.
Macro Step

A box with rectangles at the top and bottom
identified by a number represents a macro
step.
The name of the SFC that is activated by the
macro step is in a box on the right side of the
macro step.
In Step

A box with a rectangle on top identified by a
number represents an in step.
Out Step

A box with a rectangle on the bottom
identified by a number represents an out step.
Active Steps

An active step is represented by a red token
placed in the centre of the step symbol during
simulation.
Transition A transition is represented by a cross joining
two steps. A numerical marker identifies a
transition.
The transition condition is always positioned
on the right side of the transition symbol.
Creating an SFC
3-5
Name Symbol Description
Source
Transition

A source transition is a transition that is not
linked to an upstream step.
Link

A link connects the output of transition 21 to
the input of step 11.
OR
Divergence
When a connection exists between one step
and more than one transition, an OR
Divergence is drawn instead of the link.
OR
Convergence
When a connection exists between multiple
source transitions and one step, an OR
Convergence is drawn instead of the link.
AND
Divergence

When a connection exists between a single
source transition and multiple steps, an AND
Divergence is drawn instead of the link.
AND
Convergence

When a connection exists between multiple
source steps and one transition, an AND
Convergence is drawn instead of the link.
Structured
Text

Structured texts are actions that are
independent and not linked to a step; they are
linked to an SFC.
Comment

Comments can be positioned anywhere in the
diagram, they are bound to the SFC.
3.5. Description of the Circuit to Build
Before building a first SFC, open the SFC_PNEU_EN.PR4 file if you have the pneumatic
workshop, or the SFC_HYDRO_EN.PR4 file if you have the hydraulics workshop. These
files contain a pneumatic or hydraulic circuit and the SFC that is controlling the circuit. These
files are found in the EXERCISES folder. You can use these examples to build your own
SFC.
SFC Users Manual
3-6
1. Create a new project, place and name the components as per the hydraulic/pneumatic
circuit you previously opened.

You can copy and paste the components onto your new diagram.

Figure 33: Electrical and pneumatic circuit
The previous circuit is used to move a load from level 1 to level 2 and drop that load into the
left or right side bin depending on its weight. The load is first brought into the circuit with the
extension of cylinder 1. It is then brought to level 2 with the extension of cylinder 2. The
rotation direction of the motor will then determine into which bin the charge will be dropped.
Creating an SFC
3-7
3.6. Building the SFC
In the following sections, we will detail the steps that must be taken to build the following
SFC. In order to build the following SFC, you must create the diagram found in Figure 33:
Electrical and pneumatic circuit. Note that the mnemonic of the solenoid must be associated
after creating the internal variables in the SFC.

Figure 34: SFC

Note that a component from the SFC workshop cannot be connected to a component
from another workshop. Push buttons appearing in the figures are part of another
diagram.
SFC Users Manual
3-8
3.6.1. Inserting the Steps
1. Create a new SFC. Uncheck the Unconditional SFC Run checkbox.
2. In the SFC toolbar, select the Step component.

Figure 35: Step component symbol
3. In the new diagram, place the pointer where the step is to be inserted and left click.
The Step Properties dialog box appears (see Figure 3-7). For this step:
4. Make sure that the number 1 is displayed in the Number field of that step.
5. Select Initial Step in the Type list.
6. Click on the OK button.

All steps are numbered based on the first available number in the sequence.
The SFC is now:

Figure 36: Modification of the step type
Creating an SFC
3-9

Figure 37: Step Properties dialog box

Figure 38: Step Time Supervision dialog box
The zones and buttons appearing in this dialog box are:
Zones Description
A Graph Name In this zone, the name of the SFC containing the step appears. In
this dialog box, this field is non-modifiable. However, it can be
modified in the Name field of the SFC branch in the Document
Properties dialog box.
B Number A number is automatically attributed to each new step. This
number can be modified as long as it is within the 1 to 999 range.
L
D
N
M
L
I
H
A
F
E
G
O
J
K
B
C
SFC Users Manual
3-10
Zones Description
Two steps in the same SFC cannot have the same number.
C Number Lock If this option is selected, the number of the step will not be
modified during an automatic renumbering of the SFC. When the
number has been locked, an asterisk (*) appears at the centre of the
left side of the exterior frame.
D Type A drop-down list permits the selection of the step type. The choices
are: initial, normal, macro, in, and out.
E Associated Macro
Step Graph
If the step is defined as being a macro step, the associated SFC that
will activate the macro step must be defined in this zone. This field
is deactivated if the step is not defined as a macro step.
F Actions This zone is used to edit the different actions associated with the
step. Here, all of the actions associated to a step can be visualized.
This zone is deactivated for macro steps and out steps. The user
may:
Enter multiple actions by separating them with a semicolon;
Enter multiple actions submitted to the same condition by
separating them with a comma. (ex.: Action1, Action2,
Action3 IF Condition1);
Write action to be executed by using the variables and operators
found in the Guided Mode dialog box.
G Guided Mode This button provides the user access to the Guided Mode dialog
box. This button is greyed out for macro steps and out steps.
H New Variable Access the Add a variable dialog box. For more details on creating
variables, see the variables section in the Users Manual.
I External link Accesses the OPC settings dialog box to create external links
(OPC, etc.). For more details on creating external links, see the
variables section in the Users Manual.
J Unconditional
Action
This checkbox determines whether the running of the actions of the
step is conditional to the running state of the SFC (see section 4.18
Managing SFC States and Faults)
K Break Point When checked, this option will stop the simulation when the step
has been activated.
Creating an SFC
3-11
Zones Description
This button provides the user access to the Step Time Supervision
dialog box. The sequence time is calculated from the start to the
return to the initial step.
Minimum
Activation Time
It is possible, in this zone, to input a
minimum step activation time default. If the
step is active for a time lesser than the time
specified, the minimum step activation time
default will be set to TRUE (ex.:
GRA_001.SEQ_MIN_FAULT)

If used (value higher than 0), the minimum time must be
lower than the maximum time.
Maximum
Activation Time
It is possible, in this zone, to input a
maximum step activation time default. If the
step is active for a time greater than the time
specified, the maximum step activation time
default will be set to TRUE (ex.:
GRA_001.SEQ_MAX_FAULT)
L Time Supervision

If used (value higher than 0), the maximum time must be
higher than the minimum time.
M Upstream
Transitions
This button permits the visualization of the complete list of
transitions preceding the step.
N Downstream
Transitions
This button permits the visualization of the complete list of
transitions succeeding the step.
O Comment Add comments related to the action.
SFC Users Manual
3-12

Figure 39: Step Guided Mode dialog box

The Variables list in the previous table contains all of the variables in the project
associated to the SFC. See the Variables Manager in the Users Guide.

Component variables are created automatically during the pneumatic, hydraulic,
electric and Ladder logic circuit building process.
A
B
C
F
D
E
J
I
I
H
G
Creating an SFC
3-13

If during simulation an SFC calls for an undefined variable, a warning message will
appear in the messages window. The simulation will be executed but the erroneous
actions, transition conditions and structured texts will all be ignored. Transitions
with no transition condition or containing erroneous transition conditions will
always be false. To bypass the transitions, use the forcing option in the contextual
menu during simulation.
Zones Description
A Number Displays the step number during edition.
B Statement This text zone is used to enter the steps action. The statement must
follow the SFC syntax defined in Chapter 4 SFC Syntax.
C Variables This drop-down list allows the selection of variables that are global (the
entire project) or local (current diagram).
D Variable
Name
This table contains the variable names with the selected association
type.
Double-clicking on a variable selects the variable and adds it to the
action statement. The left hand side column displays the variable name
and the right hand side column, if this is the case, the associated
component. See the Variables Manager in the Users Guide.
E Syntax Describes the operator selected by a left-click in the examples list, or in
the calculator.
F Syntax
(check box)
This check box will activate syntax analysis during edition.
G New variable Accesses the Add a variable dialog box. For more details on creating
variables, see the Variables Manager in the Users Guide.
H External link Accesses the OPC Settings dialog box to create external links (OPC,
etc.). For more details on creating external links, see the Variables
Manager in the Users Guide.
I More/Less Use this button to gain access to the advanced features of the operator
calculator.
J Operators These buttons are used to enter operators in the action statement. Click
on the corresponding button to enter an operator.
SFC Users Manual
3-14

Figure 310: Upstream Transitions dialog box

Figure 311: Downstream Transitions dialog box
Zones Description
Upstream
transitions
Upstream transitions that have been validated will appear in the same
colour as active components. It is possible to select a transition in the
list. This list cannot be modified.
Downstream
transitions
Downstream transitions that have been validated will appear in the
same colour as active components. It is possible to select a transition in
the list. This list cannot be modified.
3.6.2. Inserting Transitions
1. Select the Transitions component from the SFC toolbar.

Figure 312: Transition symbol
2. Position the cursor on the Step 1 output in the diagram.
The Transition Properties dialog box appears.
Creating an SFC
3-15

Figure 313: Transition Properties dialog box
The fields and buttons appearing in this dialog box are:
Fields Description
A Graph Name In this zone, the name of the SFC containing the transition appears. In
this dialog box, this field is non-modifiable. However, it can be
modified in the Name field of the SFC branch in the Document
Properties dialog box.
B Number A number is automatically attributed to each new transition. This
number can be modified as long as it is within the 1 to 999 range. Two
transitions in the same SFC cannot have the same number.
C Number Lock If this option is selected, the number of the transition will not be
modified during an automatic renumbering of the SFC or sections of
the SFC. When the number has been locked, an asterisk (*) appears to
the right of the transition number.
D Conditions This zone is used to edit the transition condition.
E Comment Comments may be added in reference to the transition.
F Guided Mode This button opens the Guided Mode Window to edit the transition
condition. The transition condition must conform to the SFC syntax as
per Chapter 4, SFC Syntax.
D
I
H
A
F
E
G
B
C
J
SFC Users Manual
3-16
Fields Description
G New Variable Accesses the Add a variable dialog box. For more details on creating
variables, see the Variables Manager in the Users Guide.
H External Links Accesses the OPC Settings dialog box to create external links (OPC,
etc.). For more details on creating external links, see the Variables
Manager in the Users Guide.
I Upstream
Steps
This button permits the visualization of the complete list of steps
preceding the transition.
J Downstream
Steps
This button permits the visualization of the complete list of steps
succeeding the transition.


A transition with no transition condition is considered false. Only the contextual
menu during simulation permits passing a transition with no transition condition.
Creating an SFC
3-17

Figure 314: Transition Guided Mode dialog box

Operators that are not available for transitions appear greyed out in the calculator
zone.
SFC Users Manual
3-18

Figure 315: Upstream Steps dialog box

Figure 316: Downstream Steps dialog box
Zones Description
A Upstream
steps
Upstream steps that have been validated will appear in the same colour
as active components. It is possible to select a step in the list. This list
cannot be modified.
B Downstream
Steps
Downstream steps that have been validated will appear in the same
colour as active components. It is possible to select a step in the list.
This list cannot be modified.
For this transition:
1. Make sure that the number 1 is displayed in the Number field of that transition.

All transitions are numbered based on the first available number in the sequence.
2. Click on the Guided Mode button.
3. Input .1-1S1.A_IN AND.1-1S3.B_IN AND.1-1PBNO1.BP_1 in the Statement window of the
Transition Guided Mode dialog box. Proper syntax must be respected.
Creating an SFC
3-19

Use the guided mode, the variables list and calculator buttons to speed up input and
prevent syntax errors:
Double-click on A_IN in the variables list. .1-1S1.A_IN appears in the Statement
window.
Click on the button.
Continue.
4. Click on OK
The SFC is now:

Figure 317: Inserting Transition 1
3.6.3. Defining Actions
1. Select the Standard Step component in the SFC toolbar.
2. Click on the transition 1 connector (in the SFC).
The Step Properties dialog appears.
For this action:
1. Click on the Guided Mode button.
You must create the OUT_A variable and input .OUT_A IF.1-1PBNO2.COM_A in the
Statement window, to do so:
2. Click on the New Variable button.
3. Enter OUT_A in the Tag Name field and click OK.
The OUT_A variable automatically appears in the Statement window of the Step Guided
Mode dialog box.
4. Click the IF button, then select the COM_A variable.
5. Click OK to validate and to close the Step Guided Mode dialog box.
6. Then click OK to close the Step Properties dialog box.
SFC Users Manual
3-20
SFC is now:

Figure 318: Defining an action

To modify the properties of an inserted component (step or transition), double-click
on it to access its properties dialog box.
3.6.4. Inserting Links Between Components

Connection positioning is facilitated with the visual representation of connections.
On each component, connections will appear as a red circle on the connection points
of components and links. These circles will change colours when a valid connection
is established. When a cursor is positioned over these connection points, the link tool
will appear. (For more details, see the Inserting Links chapter in the users manual).
1. Insert transition 2, step 3 and transition 3. Create the OUT_B variable.

Figure 319: Transition 2, step 3 and transition 3
3.6.5. AND Link
Prior to creating an AND convergence or divergence, two Standard steps must inserted in the
SFC along with the IN_A and IN_B variables as shown in the next figure.
Creating an SFC
3-21

Figure 320: Steps prior to an AND divergence
Once the two Standard steps with their variables have been inserted in the SFC, create the
link. To do so:
1. Click and hold transition 3 open connection and drag it to step 4.
A new link is inserted.
2. Repeat for step 5.
The link between transition 3 and steps 4 and 5 changes to a double line.

An AND divergence is automatically created if a transition is connected to more than
one step. An AND convergence is created if more than one step is connected to a
single transition.

To enlarge an AND link just add a link on another step/transition. It is also possible
to move a step or transition and use the Adjust Convergence option from the link
contextual menu.

To move an AND link, left-click on a link and move it while keeping the button
pressed.

To rearrange an AND link, select the link and choose SFC Links and Branches
Base Fit Redraw. The link will automatically redraw and take the shortest route
between components.
SFC Users Manual
3-22
SFC after inserting the links:

Figure 321: Steps following the creation of the AND divergence
Do the following:
3. Add transition 4 and input T/X4.X/T#1s/ in the Conditions window of the Transition
Properties dialog box.
4. Connect steps 4 and 5 to transition 4.
5. Add step 6.
The SFC is now:

Figure 322: SFC after having inserted an AND convergence
Creating an SFC
3-23
3.6.6. OR Link
To create an OR divergence or convergence, the steps or transitions must first be created.

Figure 323: SFC prior to inserting an OR convergence
1. Add transition 5 and insert .1-1PBNO4.M_A in the Conditions window of the Transition
Properties dialog box.
2. Add transition 6 and insert .1-1PBNO5.M_B in the Conditions window of the Transition
Properties dialog box.
3. Click and hold step 6 open connection and drag it to transition 5.
4. Repeat for transition 6.
5. Add step 7 and create a new variable named OUT_C.
6. Add transition 8 and insert T/ X8.X/T#5s/ in the Conditions window of the Transition
Properties dialog box.
7. Add step 8 and create a new variable named IN_C.
8. Add transition 7 and insert T/X7.X/T#5s/ in the Conditions window of the Transition
Properties dialog box.
9. Add an OR link from transitions 7 and 8 to step 1.
SFC Users Manual
3-24
10. On another diagram, from the electrical controls library, select five push-button
components and name them respectively PB_1, COM_A, COM_B, M_A and M_B.
These push buttons will be used to command the SFC.

An OR divergence is created if one step is connected to multiple transitions. An OR
convergence is created when more than one transitions are connected to a single step.

To enlarge an OR link; simply add a link to another step/transition. When a step or
transition is displaced, use the Adjust option from the link contextual menu to
correctly position the link.

To move an OR link, left-click and keep the link button pressed, then move the link.

To rearrange an OR link, select the link and the Links and Convergence Rearrange
Convergence option from the SFC menu. The link will automatically be redrawn and
take the shortest route between components.

To rearrange an OR link containing jumps, select the jumps and choose SFC
Links and Branches Base Fit Redraw. The link will automatically be redrawn and
take the shortest route between components.
Creating an SFC
3-25
The SFC is now:

Figure 324: SFC after the insertion of an OR convergence
3.6.7. Inserting Structured Texts
Structured texts are autonomous actions that are not associated to a step. They are activated if
the simulation is active. The syntax used is the same as in both steps and transitions. To insert
a Structured Text component:

Figure 325: Example of a Structured text
1. Select the Structured Text component from the SFC toolbar.
2. Place the pointer and click on the right side of step 1 of your SFC..
SFC Users Manual
3-26
The Structured Text Properties dialog box appears.
3. For this structured text statement insert SFC 1.RUN :=1. Then, insert Activation
unconditional to the SFC in the Comment window of the Structured Text Properties
dialog box.
The SFC is now:

Figure 326: SFC after inserting a structured text
Creating an SFC
3-27

Figure 327: Structured Text Properties dialog box
The zones and buttons of this dialog box are:
Zones Description
A Graph Name The name of the SFC that contains the structured text. In this dialog
box, this field is non-modifiable. However, it can be modified in the
Name field of the SFC branch in the Document Properties dialog box.
B Number A number is automatically attributed to each new structured text. This
number can be modified as long as it is within the 1 to 999 range. Two
structured texts in the same SFC cannot have the same number.
C Number Lock If this option is selected, the number of the structured text will not be
modified during an automatic renumbering of the SFC or of sections of
the SFC. When the number has been locked, an asterisk (*) appears to
the right of the transition number.
D Structured
Text
Use this zone to define the structured text statement. Structured texts
must conform to SFC syntax guidelines as defined in Chapter 4, SFC
Syntax.
E Comment Add comments in reference to the structured text.
F Guided Mode This button accesses the Structured Text Guided Mode dialog box to
edit the structured text.
D
H
A
F
E
G
B
C
SFC Users Manual
3-28
Zones Description
G New variable This button accesses the Add a variable dialog box. For more details on
creating variables, see the Variables Manager in the Users Guide.
H External Link This button accesses the OPC Settings dialog box to create external
links (OPC, etc.). For more details on creating external links, see the
Variables Manager in the Users Guide.
3.6.8. Inserting Comments
Comments are not bound to steps/transitions.

Figure 328: Example of a comment
1. Select the Comment component from the SFC toolbar.
2. Position the pointer and click under the structured text component of your SFC.
The Comment Properties dialog box appears:
3. For this comment, input Realizing a first SFC.
Creating an SFC
3-29
The SFC is now:

Figure 329: SFC after inserting a comment

Figure 330: Comment Properties dialog box
D
A
B
C
SFC Users Manual
3-30
The zones and buttons in this dialog are:
Zones Description
A Graph Name The name of the SFC that contains the comment. In this dialog box, this
field is non-modifiable. However, it can be modified in the Name field
of the SFC branch in the Document Properties dialog box.
B Number A number is automatically attributed to each new comment. This
number can be modified as long as it is within the 1 to 999 range. Two
comments in the same SFC cannot have the same number.
C Number Lock If this option is selected, the number of the comment will not be
modified during an automatic renumbering of the SFC or sections of
the SFC. When the number has been locked, an asterisk (*) appears to
the right of the transition number.
D Comment Add comments.
3.7. Error Prevention
It is possible, at any time, to check for errors such as missing links between steps/transitions.
The Errors command from the SFC menu is used to identify components that are not linked,
transitions without transition conditions, erroneous syntax, etc. These errors will appear in the
Messages window.

Figure 331: Messages window
For more detail, refer to the Messages Window section of the Users guide.

4-1
4. SFC Syntax
4.1. Introduction
A functioning SFC will treat one or more expressions, each composed of variables, constants,
numbers and operators. The syntax defines the rules that must be respected for the
identification of symbols and the writing of expressions.
This chapter presents a detailed description of syntax while using SFC components, symbols
and processes. The following subjects are discussed:
Identifier Nomenclature;
Variables;
Constants;
Real and Integer Expression Operators;
Boolean Expression Operators;
Edge Detecting Operators;
Relational Operators;
Operator Priority;
Assignment;
Syntax Verification;
Examples of Action-Steps;
Example of A Transition;
Structured Texts;
Comments;
Timing;
Managing SFC State;
Managing SFC Faults;
Forcing Order.
SFC Users Manual
4-2
4.2. Identifier Nomenclature
Nomenclature is used to affect physical interpretation to each SFC symbol. This
interpretation uses steps, transitions and variables. As soon as any of these items is created,
with the exception of variables, Automation Studio will automatically generate a name.
Names are identifiers and must respect these basic rules:
They are composed of standard alphanumeric characters: '' a-z, A-Z, 0-9, _, +, -;
They always begin with a letter or number.
They can be composed of multiple elements, each of these separated by a period (.). For
example, a step state from a SFC is named Name_Chart.X18.X.
They can be in upper or lower case. Once entered and recognized by the software upper
case will be used to display names.
Except for variables that are local to a SFC, variable tag names must be preceded by a
period (.).
They are composed of 1 to 32 characters.
They do not contain any empty characters (spaces).
They do not contain any accented characters.

If the SFC is used to control electro-pneumatic, ladder, electric or digital circuits
make sure that the nomenclature of the components from those circuits follow these
same rules.
4.2.1. Steps
When inserting a new step, the software will automatically assign to it a new number to it
within the 1 to 999 range. Each step will then have a unique number in an SFC.

Figure 41: Inserting a step
By convention, if n represents the step number, the variable Xn.X represents the logical state
({inactive, active}or {0,1}) of step n. For example, X2.X represents the logical state of step 2.
SFC Syntax
4-3
The logical state of a step can be used in a logical expression by using its name Xn.X. If it is
used in another SFC, the logical state is given by SFC_Name.Xn.X.
In the same fashion, Xn.T will return the amount of milliseconds of time that have passed
since the last step activation. This value can be compared to other values with the help of the
operators.

Actions associated to a step are processed in the same order as they are declared.
However, if more than one step or structured text from multiple SFCs affects the
same variable, they are executed after the actions of the last SFC.
4.2.2. Transition
When a new transition is inserted in an SFC, the software automatically assigns a transition
number within the 1 to 999 range. Each transition will have a unique number within an SFC.

Figure 42: Inserting a transition
By convention, if n represents the number of a transition then the variable Yn.Y represents the
logical state of the transition ({Validated and passable, not validated}or {0,1}). For example,
Y2.Y represents the logical state of transition 2.

The =1 notation associated to a transition indicates that the transition condition is
always TRUE;

If the transition condition field is empty, then it is considered to be always FALSE
(equivalent to =0).
SFC Users Manual
4-4
4.2.3. Structured Text
When a new structured text is inserted, the software will automatically assign to it a number
within the [1,999] range. Each structured text in the same SFC will have a unique number.

Figure 43: Inserting a structured text
By convention, the structured text is named STn, where n is the number of the structured text.
Structured texts are processed in the order that they are numbered after the normal steps
of the SFC have been executed.
4.2.4. Comments
When a comment is inserted, the software will automatically assign to it a number within the
1 to 999 range. Each comment in the same SFC will have a unique number.

Figure 44: Inserting a comment
By convention, a comment is named Cn where n is the number of the comment.
4.2.5. Reserved Keywords
The SFC workshop has reserved keywords, meaning that they cannot be used as identifiers.
Names beginning with X are reserved for steps.
Names beginning with Y are reserved for transitions.
Keywords OR, XOR, AND, and NOT are reserved for the Boolean operators.
Keywords F/ and T/ are reserved for the forcing and timer operators.
Keywords MOD, ABS, SQRT, LN, LOG, EXP, SHL, SHR, ROL, ROR, INC, DEC,
SIN, COS, TAN, ASIN, ACOS, ATAN, RAD_DEG, DEG_RAD, DEC_BCD,
BCD_DEC, SEL, MIN, MAX, LIMIT, and MUX are restricted to mathematical
operators.
Keyword IF is reserved for the conditional operator.
SFC Syntax
4-5

If you need to control hydraulic, pneumatic, electric, or digital circuits, the
components tag names from those circuits must not contain any reserved keywords.

When you insert actions and transitions, the expressions they contain will be
displayed using a different colour if the expressions are not syntactically correct. See
Chapter 4-13 Syntax Error Prevention.
4.3. Variables
4.3.1. Variable Types
The variable type depends on the information it contains. Variable types are presented with
the Variables Manager in the Users Manual. The following table lists the possible variable
types that can be used for internal logic.
Variable type Description
Boolean variable
BOOLEAN
The value of a Boolean variable can either be 0 or 1, TRUE (ON), or
FALSE (OFF).
Integer INTEGER This variables value is a whole number in the -2,147,483,648 to
+2,147,483,647 range.
Real variable
REAL
This variables value is a real number as per IEC 559.
Time variable
TIME
This variables value is a time duration in the following format:
T#3d_18h_4m_15s_23ms where
d = days
h = hours
s = seconds
ms = milliseconds
4.3.2. Creating Variables
A new variable can be created with the help of the New Variable button found in the
Properties dialog box of steps/transitions/structured texts or from the Variables Manager
window. For more details on creating variables, refer to the Variables Manager section of the
Users Guide.
SFC Users Manual
4-6
4.3.3. Creating External Links on Variables
It is possible to create external links (OPC) on variables with the use of the External Links
button that appears in the Properties dialog boxes of steps/transitions/structured texts. For
more details on creating external links, see Variable manager in the Users Guide.
4.4. Constants
Constants are fixed values that can be of the same type as variables.
4.5. Basic Arithmetic Expression Operators
The following operators are used with integer and/or real variables. Depending on the desired
format, the expressions can output in real or integer values. Type conversion is done
automatically. The following table describes operator category, operand type and, if needed, a
brief description and/or example.
Operator Description and example
+ Unary operation (positive value)
E.g.: Val1 := +25
+ Addition
E.g.: Val1 := Val2 + Val3
- Unary operation (negative value)
E.g.: Val1 := -25
- Subtraction
E.g.: Val1 := Val2 Val3
/ Division E.g.: Val1 := Val2 / Val3
MOD Remainder of the division operation, operands must be integers.
E.g.: Val1 := Val2 / Val3
* Multiplication
E.g.: Val1 := Val2 * Val3
4.6. Advanced Mathematical Expression
Operators
The following operators are used with integer and/or real variables. Depending on the desired
format, the expressions can output in real or integer values. Type conversion is done
SFC Syntax
4-7
automatically. The following table describes operator category, operand type and, if needed, a
brief description and/or example.
Operator Description and example
ABS Absolute value, real or integer
ABS(Ls1)
SQRT Square root, real numbers only
SQRT(Ls1)
LN Napierian logarithm, real numbers only
LN(Ls1)
LOG Base 10 logarithm, real numbers only
LOG(Ls1)
EXP Natural exponent, real numbers only
EXP(Ls1)
SIN Sine, real numbers only
SIN(Ls1)
COS Cosine, real numbers only
COS(Ls1)
TAN Tangent, real numbers only
TAN(Ls1)
ASIN Arc sine, real numbers only
ASIN(Ls1)
ACOS Arc cosine, real numbers only
ACOS(Ls1)
ATAN Arc tangent, real numbers only
ATAN(Ls1)
** Exponent, real or integer
Ls1 ** Ls2
SFC Users Manual
4-8
Operator Description and example
SHL Shift left, strings and integers only
Ls1 := SHL(Ls2,1),
Left shift Ls2 by 1 position
The result is affected to Ls1, Ls2 keeps its original value.
Ls1 := SHL(Ls2,Ls3),
Left shift of Ls2 by Ls3 positions
The result is affected to Ls1, Ls2 keeps its original value.
Ls2 := SHL(Ls2,Ls3)
Left shift of Ls2 by Ls3 positions
The result is affected to Ls2, Ls2 takes on the final value.
SHR Shift right, strings and integers only
Ls1 := SHR(Ls2,1),
Right shift Ls2 by 1 position
The result is affected to Ls1, Ls2 keeps its original value.
Ls1 := SHR(Ls2,Ls3),
Right shift of Ls2 by Ls3 positions
The result is affected to Ls1, Ls2 keeps its original value.
Ls2 := SHR(Ls2,Ls3)
Right shift of Ls2 by Ls3 positions
The result is affected to Ls2, Ls2 takes on the final value.
ROR Rotational right shift, strings and integers only
Ls1 := ROR(Ls2,1),
Rotational right shift of Ls2 by 1 position, Ls2 is not modified.
Ls1 := ROR (Ls2,Ls3),
Rotational right shift of Ls2 by Ls3 positions, Ls2 is not modified.
Ls2 := ROR(Ls2,Ls3)
Rotational right shift of Ls2 by Ls3 positions
The result is affected to Ls2, Ls2 takes on the final value.
SFC Syntax
4-9
Operator Description and example
ROL Rotational left shift, strings and integers only
Ls1 := ROL(Ls2,1),
Rotational left shift of Ls2 by 1 position, Ls2 is not modified.
Ls1 := ROL (Ls2,Ls3),
Rotational left shift of Ls2 by Ls3 positions. Ls2 is not modified.
Ls2 := ROL(Ls2,Ls3)
Rotational left shift of Ls2 by Ls3 positions
The result is affected to Ls2. Ls2 takes on the final value.
INC Incrementation of real or integer values
Ls1:= INC(Ls2, 1),
The value of Ls2 incremented by 1 the result is affected to Ls1.
INC(Ls2,Ls3)
The value of Ls2 is incremented by Ls3.
DEC Decrementation of real or integer values
Ls1:= DEC(Ls2, 1),
The value of Ls2 decremented by 1 the result is affected to Ls1.
DEC(Ls2,Ls3)
The value of Ls2 is decremented by Ls3.
SEL Binary selection between Booleans, reals or integers
Ls1 :=SEL(G, In1, In2)
Binary selection, if G=1, output = In2
The selection indicator G must be a Boolean, if G=0 output = In1, if
G=1 output = In2
MIN Minimum of multiple values, real or integer
Ls1:= MIN(In1, In2, , In16)
Minimum value of a maximum 16 variables.
MAX Maximum of multiple values, real or integer
Ls1:= MAX(In1, In2, , In16)
Maximum value of a maximum 16 variables.
SFC Users Manual
4-10
Operator Description and example
LIMIT Value limiter, real or integer
Ls1:=LIMIT(IN, MIN, MAX)
Limiter,
Output = MIN threshold if input is lesser than MIN threshold,
Output = MAX threshold if input is greater than MAX threshold,
Output = IN if input value is between MIN and MAX thresholds.
.Ls1 :=LIMIT(.LS2, .LS3,.LS4),
MUX Multiplexing between multiple inputs, Booleans, reals or integers.
Ls1:= MUX(K, In1, In2, , In16)
Multiplexer
The output is the input value selected by K, K must be an integer in the
range of 0-16.
If K=0, output is 0 (false for Booleans).
Instruction MUX(K, In1, In2, , In16): If K is >16 or <0, the
instruction is not executed and a message will appear in the Messages
Window.
BCD_TO_DEC Conversion from BCD to decimal, integers only
Ls1:= BCD_TO_DEC(Ls2)
DEC_TO_BCD Conversion from decimal to BCD, integers only
Ls1:= DEC_TO_BCD(Ls2)
RAD_TO_DEG Conversion from radians to degrees, integers only
Ls1:= RAD_TO_DEG(Ls2)
DEG_TO_RAD Conversion from degrees to radians, integers only
Ls1:= DEG_TO_RAD(Ls2)
4.7. Boolean Expression Operators
These operators can be used to assign a Boolean expression to a variable or to verify a
transition condition. The result is always Boolean. The following table describes these
operators.
Operator Description
OR Logical OR between strings or Boolean values.
E.g.: ls1 OR ls2
XOR Exclusive logical OR between strings or Boolean values.
E.g.: ls1 XOR ls2
SFC Syntax
4-11
Operator Description
AND Logical AND between strings or Boolean values.
E.g.: ls1 AND ls2
NOT Negation of a string or Boolean value
E.g.: NOT ls1
4.8. Edge Operators
An expression constructed with an edge operator is a Boolean expression that reacts to
changes of state.
An edge operator is a specific operator that indicates if a Boolean variable changes value
from 0 to 1 or from 1 to 0.
There are two types of operators: rising edge operator and falling edge operator. They are
defined in the following table:
Operator Description
^B
or
R_TRIG(B)
Rising edge
Rising edge operator. The edge operator becomes TRUE when the operand
changes from FALSE to TRUE.
Example: A IF ^B.
A becomes TRUE when B changes from FALSE to TRUE.
!
or
F_TRIG(B)
Falling edge
Falling edge operator. The edge operator becomes TRUE when the operand
changes from TRUE to FALSE.
Example: A IF !B.
A becomes TRUE when B changes from TRUE to FALSE.

Figure 45: Timing diagram of an action using a rising edge operator
SFC Users Manual
4-12
4.9. Relational Operators
These operators are used to compare variables and/or numerical values (numbers, constants).
The result is a Boolean value. If the comparison is true the output is TRUE and FALSE if the
comparison is false.
Operator Description
> Expression A > B is true if the value of A is greater than the value of B.
>= Expression A >= B is true if the value of A is greater than or equal to the value
of B.
= Expression A = B is true if the value of A is equal to the value of B.
<= Expression A <= B is true if the value of A is lesser than or equal to the value
of B.
< Expression A < B is true if the value of A is lesser than the value of B.
<> Expression A <> B is true if the value of A is different from the value of B.
4.10. Operator Priority
The priority of operators influences the way that expressions are evaluated.
The following table lists the operators by order of priority. The operator on top has the
highest level of priority while the operator at the bottom has the lowest. For operators on the
same row, the operator on the left has more priority than the operator on the right.
Operator Priority
() Parentheses
+, -, NOT, ^, ! Unitarian Operators
*, / Multiplication Operators
+, - Additive Operators
<, <=, >, >= Relative Operators
=? <> Relative Operators
XOR Additive Operators
AND Additive Operators
OR Additive Operators
SFC Syntax
4-13
The only way to override these priorities is by using parenthesis. In that case, the expression
that is within the most parenthesis has the highest priority.
4.11. Assignment operators
Assignment operators define the types of action and their effects. They can be applied to
integers, reals, Booleans, and strings. They are used in actions and structured texts. The
following section describes the different assignment operators and their use.
The execution of an action is conditioned by the active state of the step and the SFC, unless
the unconditional option is checked for the step. In this case, the execution of the action is
dependant only of the active state of the SFC.
4.11.1. Continuous Boolean Assignment
The Continuous Boolean Assignment (or unconditional action in a step) returns the value
TRUE to the variable as long as the assignment continues. There are no assignment operators.
The variable becomes TRUE when the step is activated then becomes FALSE when it is
deactivated.
The syntax of a continuous Boolean action is the same as the name or tag name of the
variable. In this case, you must not use an assignment operator.

Figure 46: Continuous Boolean assignment in an action
In this example:
COIL is a Boolean variable that is global to the project;
When step 4 is activated, COIL becomes TRUE and will retain that value until step 4 is
deactivated.
When step 4 is deactivated, COIL returns to FALSE.
SFC Users Manual
4-14
4.11.2. Numeric Assignment
The Numeric Assignment Operator assigns a value (variable, constant or the result of a
calculation) to a numeric value. The numeric assignment operator sign is :=.

Figure 47: Numeric assignment
In this example:
Variables A, B, C, D, and E are real numerical variables.
When step 4 is active, variable A is assigned the value of the expression ( B + C ) / D.
Variable A keeps the last value of ( B + C ) / D when step 4 is deactivated.
When step 5 is active, the variable E is incremented by 1.
4.11.3. Conditional Boolean Assignment
The Conditional Boolean Assignment makes it possible to assign the state of a variable or of
an expression to a Boolean variable if a certain condition is met. In the contrary case, FALSE
is assigned to the Boolean variable. The conditional assignment operator's sign is: IF.

Figure 48: Conditional Boolean assignment
In this example:
When step 4 is active the state of the Boolean variable COIL is the same as the state of
the R_TRIG(X1.X) expression;
When step 4 is inactive, the Boolean variable COIL is FALSE.
SFC Syntax
4-15
4.11.4. Conditional Numerical Assignment
This type of assignment is done when the specified condition is TRUE. The conditional
numerical assignment operators are: IF and :=.

Figure 49: Conditional numerical assignment
In this example:
When step 6 is active, variable B equals 3 if the expression NOT COIL is TRUE.
When step 6 is inactive, B keeps its last value.
4.11.5. Stored Boolean Assignment
The stored Boolean assignment makes it possible to assign to a variable a state of TRUE or
FALSE, a state that it retains (stored). To assign the state of TRUE or FALSE to a variable,
the operators of assignment are respectively: := 1 or := 0.

Figure 410: Stored assignment
In this example:
Variable A equals TRUE when step 5 is active and keeps this value after the deactivation
of step 5.
Variable A equals FALSE when step 10 is active and keeps this value when step 10 is
deactivated.
SFC Users Manual
4-16
4.12. Syntax Error Prevention
To help eliminate syntax errors during editing, the software will automatically colour code
syntax elements as soon as they are recognized. For example, if an operator is entered, the
software will automatically colour the element with the corresponding colour, it is then easy
to analyse syntax and structure and check for errors.
To associate colours to syntax elements:
1. Select Tools Options SFC Module.
The Options dialog box appears.
2. Click on the SFC Module branch.
3. Check the option Apply Colours to Syntax Elements.
4. Modify the colours associated to the elements.
5. Click on Apply to execute the changes.

Figure 411: Options dialog box, SFC Module branch
If the Apply Colours to Syntax Elements is not checked, no syntax checking will be
performed during edition. However, if syntax is incorrect, it will be displayed in the same
colour as a faulty component on your SFC.
SFC Syntax
4-17
To modify the colour associated to a faulty component:
1. Select the Options command from the Tools menu.
2. Click on the Kernel branch.
3. Select the colour to be associated with faulty components.
4. Click on Apply to execute the changes.

Figure 412: Configuration dialog box, Kernel branch
4.13. Example of a Step Action
A step action is a process that is carried out when the step is active and the SFC is running.
The actions are made up of expressions, assignment operators, and command operators. They
are used to transmit commands to the Operative part when the step is active and the SFC is
running.
When multiple actions are associated to a step a semicolon separates them. When multiple
actions are subject to the same condition, a comma separates them.
SFC Users Manual
4-18

Figure 413: Example of a step action
4.14. Example of Transition
A transition condition is associated to every transition (if there is no transition condition
specified then the condition is considered to be FALSE). The transition condition decides if
the next step is going to be executed or not. It is composed of a Boolean expression written
using the input variables, step variables (Xn.X), logical operators, timers and edge operators.
The transition condition can also have a comment associated to it.

Figure 414: Transition condition
4.15. Structured Text
Structured texts behave exactly like regular actions with the exception that they are not
connected to any steps. They are executed continuously at each simulation cycle and just
before the initial step of an SFC.
Each SFC may hold up to 999 structured texts and they may be placed anywhere. When more
than one structured texts are declared in an SFC, they are executed in the order they are
numbered (ST3, ST9, ST14).
SFC Syntax
4-19

Figure 415: Structured texts: order of execution
4.16. Comments
Comments are associated to the SFC in which they are declared.
Up to 999 comments can be inserted anywhere in an SFC.

Figure 416: Comments
4.17. Timers
There are four (4) types of timers:
On-delay timer (T/, TON/).
Off-delay timer (TOF/).
Pulse delay timer (TP/).
Step elapsed time (Xn.T).
Timers are Boolean operators that take time into consideration (delay, wait state, etc.). They
are written in the following forms T/En/timelength/ , TON/En/ timelength / , TOF/En/
timelength /, TP/En/ timelength / where:
T/ or TON/ or TOF/ or TP/ is the timer operator;
En is the input variable, the name of the step or variable that will start the timing process;
Timelength is a numerical variable specifying the duration of the countdown.
E.g.: T#3j21h45m30s454ms.
SFC Users Manual
4-20
Time base Symbol
Day j/
Hour h/
Minute m/
Second s/
Millisecond ms/
4.17.1. Timer On-delay
Timers T/Var_a/T#t1s/ are set to the logical value 1 as soon as t1 seconds have
elapsed since the last rising edge of Var_a. The timer is reset to 0 at every deactivation of
Var_a.
The example in the next figure demonstrates the evolution of the following timers:
T/Var_a/T#3s/and NOT( T/Var_a /T#3s/).

Figure 417 : Timer on-delay
If during simulation the variable Var_a is activated, timing is started, the Boolean expression
T/Var_a/ T#3s / becomes FALSE, the Boolean expression T/NOT Var_a / T#3s/
becomes FALSE and the Boolean expression NOT( T/Var_a / T#3s /) becomes TRUE.
Three seconds following the activation of Var_a the Boolean expression T/Var_a/T#3s/
changes state from FALSE to TRUE and NOT(T/Var_a/T#3s /) from TRUE to FALSE.
They will both keep their values until the next deactivation of Var_a.
If, during the timing process, Var_a is deactivated, the timing is stopped and the Boolean
expressions T/ Var_a /T#3s/ and NOT (T/ Var_a / T#3s /) change values respectively to
FALSE and TRUE.
Timers can be used to define delayed or time limited actions.
SFC Syntax
4-21


Figure 418: On-delay timer timing chart
4.17.1.1. Delayed Actions
Delayed actions are executed after the preset delay has elapsed.

Figure 419: Delayed assignments
Step 2: The Stop variable becomes TRUE if the variable Var_b remains activated for 3
seconds. Once step 2 is deactivated, the variable Stop becomes FALSE;
Step 3: The variable Stop becomes TRUE if Var_b remains inactivated for 3 seconds.
Once step 3 is deactivated, the Stop variable becomes FALSE.
SFC Users Manual
4-22
4.17.1.2. Time-Limited Actions
Time-limited actions are executed from a preset period of time.

Figure 420: Time-limited assignment
Moteur is TRUE until Var_a remains activated for 3 seconds. Moteur then changes to
FALSE. Once Var_a is deactivated, Moteur changes back to TRUE.
4.17.2. Off-Delay Timer
When the timer is energized (Var_a), the timer is activated and the counter is reset to zero (0).
When the timer is de-energized, the counter will continue counting until it has reached the
preset time.
When the counter reaches the preset time, the timer is deactivated and the counter stops. If the
timer is re-energized before the preset time has been reached, it will stay active.
As soon as the timer is energized (Var_a), the timer becomes inactive and the counter is reset
to zero (0).

Figure 421: Off-delay timer time chart
4.17.3. Pulse Timer
When the timer is energized (Var_a), the timer is activated.
The counter will increment until its value reaches the preset time even if the input variable
(Var_a) becomes inactive before the preset time is reached.
When the counter has reached the preset time, the timing is deactivated and the counter stops.
SFC Syntax
4-23
When the timer is no longer energized (Var_a), the timer will become inactive only if the
preset time has been reached. In this case, the counter is reset to zero (0) if the timer is
inactive and no longer energized.

Figure 422: Impulse timer time chart
4.17.4. Step Timer
Based on the international standard IEC 1131-03, the activation time of a step
SFC_Name.Xn.T/ is counted from the last rising edge of step Xn . It does not change
values at the deactivation of step Xn but resets at 0 at each new activation of Xn . The
counter output is an integer representing the number of milliseconds that have passed.
The following example demonstrates the evolution of the step time counter. If during
simulation step X1 is activated, the counter is reset to zero (0).
When step X1 is deactivated, the counter stops and keeps the value until the next reactivation
of step X1.

Figure 423: Step timer time chart X1.T
SFC Users Manual
4-24
Step timers can be used to defined delayed actions; time limited actions, transitions conditions
or action conditions with the help of the relational operators. E.g.:

Figure 424: Using step timer: X1.T
4.18. Managing SFC States and Faults
SFCs can be considered as black boxes where information is inputted and results are
outputted.
Variables and commands are used as inputs to the SFCs. These will, in return, output internal
variables and new variable states.
Commands and SFC states are internal variables to the SFC. The following table describes
these:
Internal SFC variable Description
Inputs:
INIT SFC initialisation command.
RUN Authorization to run the SFC and to execute its steps
and actions.
ESC External security condition making the running of the
SFC useless or dangerous.
STEP_MAX_ACK Acknowledge the step maximum duration fault.
STEP_MIN_ACK Acknowledge the step minimum duration fault.
SEQ_MAX_ACK Acknowledge the sequence maximum duration fault.
SEQ_MIN_ACK Acknowledge the sequence minimum duration fault.
Outputs:
FORCED SFC forced state.
RUNNING SFC running state.
GEN_FAULT General SFC fault state. Indicates the presence of a
fault or of the external security condition.
STEP_MAX_FAULT Signal the step maximum duration fault.
SFC Syntax
4-25
Internal SFC variable Description
STEP_MIN_FAULT Signal the step minimum duration fault.
SEQ_MAX_FAULT Signal the sequence maximum duration fault.
SEQ_MIN_FAULT Signal the sequence minimum duration fault.

Figure 425: SFC input and output variables
4.18.1. Managing SFC States
SFCs states and commands are accessible through actions, transition conditions, and
structured texts These states are:
INIT: Initialize the SFC on its initial steps and deactivate all other steps when changed to
TRUE. E.g.: GRA_003.INIT IF EM_STOP.
RUN: Authorize SFC evolution and execution when TRUE. Example: GRA_003.RUN
IF INITIAL_CONDITIONS. It is possible to define a step in a way that its actions are
not conditional to the run state of the SFC.
RUNNING: Indicates that the SFC is being executed, this is available in read only. AN
SFC is running if one of its initial steps is not active. For macro step SFCs, it is running
if the source macro step is active GRA_003.RUNNING. This variable is processed by
the software as per the following equations:
Internal processing for running SFC state information storage:
SFC_Name.RUNNING := 1 IF NOT SFC_name.X01.X
SFC Users Manual
4-26
Reset running SFC storing if the minimum sequence time is monitored:
SFC_Name.RUNNING := 0 IF ((SFC_Name.SEQ_TMIN_Q OR
SFC_Name.SEQ_MIN_FAULT ) AND
SFC_NameX01.X )
OR
SFC_Name.INIT
Reset running SFC storing if the minimum sequence time is not monitored:
SFC_Name.RUNNING := 0 IF SFC_NameX01.X OR SFC_Name.INIT
Macro step running SFC storing:
SFC_Name.RUNNING := 1 IF SFC_Name_Source.X??.X
Reset macro step running SFC storing:
SFC_Name.RUNNING := 0 IF NOT SFC_Name_Source.X??.X

Macro step SFCs cannot have sequence-running monitoring because they do not
have initial steps.
FORCED: Indicates if the SFC is forced by another (read only). GRA_003.FORCED.???
GEN_FAULT: SFC general fault indicates that an SFC fault is present or not acquitted
(read only). TRUE if a fault is present or not acquitted. FALSE if all faults are no longer
present or have been acquitted (see next section).
4.18.2. Managing SFC Faults
Faults are detected on user demand, these are:
SEQ_MIN_FAULT: Sequence minimum time fault. SFC returns to initial step too
quickly (GRA_001.SEQ_MIN_FAULT).
SEQ_MAX_FAULT: Sequence maximum time fault. SFC returns to initial step too
slowly (GRA_001.SEQ_MAX_FAULT).

To monitor sequence time, an SFC must have only one initial step.
SFC Syntax
4-27
STEP_MIN_FAULT: Step minimum time fault. Exit step too quickly
(GRA_001.STEP_MIN_FAULT).
STEP_MAX_FAULT: Step maximum time fault. Exit step too slowly.
(GRA_001.STEP_MAX_FAULT).
ESC: External security condition. This can be defined by multiple conditions. It does not
generate any new faults (GRA_001.ESC).
If one of these faults is present or not acquitted or if the external security fault is present, the
SFC general fault (GRA_001.GEN_FAULT) is automatically set to TRUE by the simulation
engine as per the following equation:
GEN_FAULT := SEQ_MIN_FAULT OR SEQ_MAX_FAULT OR
STEP_MIN_FAULT OR STEP_MAX_FAULT OR ESC

The SFC general fault does not generate a fault.
It is therefore possible for the user to use the states and faults to manage the running (RUN),
the initialization and/or the forcing states of the SFC. Example:
GRA_001.ESC IF EMRGENCY_STOP
GRA_001.RUN := NOT GRA_001.GEN_FAULT AND CONDITIONS
GRA_001.INIT := NOT GRA_001.GEN_FAULT AND PB_REARM
If these faults are used, it is important to foresee a mechanism so that the user can be warned
of the faults and can acknowledge them. It is possible to use a call light to warn and a push-
button to acknowledge.
For example, two structured texts of an SFC can perform the following actions:
Signalling faults:
LT_AL_GRA_001 IF GRA_001.GEN_FAULT
Acknowledging faults:
GRA_001.STEP_MAX_ACK_ACK,
GRA_001.STEP_MIN_ACK_ACK,
GRA_001.SEQ_MAX_ACK_ACK,
GRA_001.SEQ_MIN_ACK_ACK IF
PB_ACK_ACK _GRA_001
SFC Users Manual
4-28
4.19. Macro Steps
A macro step is a section of the SFC represented condensed in a single step. For each macro
step there is a macro step SFC that explodes the source macro step. The name of the SFC is
inscribed in the action box on the right hand side of the macro step.
The in step of the macro step SFC and the parent macro step SFC are activated
simultaneously. It is in fact an implicit AND divergence.
The out step of the macro step SFC is deactivated simultaneously with the parent macro step
SFC. This happens when the transition that follows the parent macro step SFC is fired. It is in
fact an implicit AND convergence.
1 T/X1.X/T#1s/
24
2 M_A
1
2
B0
M1 SFC
3 a1 =1 AND b1 =1
GRA_004 SFC
1
1 a0 =1 AND b0 = 1 AND BP_1
M1
2
2 a1 =1 AND b0 =1
3
B1 IF COM_B
M1 is the Macro step SFC that explodes the
macro step
Step X24 of the M1 SFC is deactivated when the
Y2 transition of the GRA_004 SFC is passed
Step X1 of the M1 SFC is activated when
step X2 of the GRA_004 SFC is activated after
passing transition Y1 of the GRA_004 SFC
The Y2 transition of the GRA_004 SFC can be passed if
step X2 of SFC GRA_004 is active AND step
X24 of the M1 SFC is active AND the condition of
transition Y2 of the GRA_004 SFC is TRUE

Figure 426: Using macro steps
SFC Syntax
4-29
4.20. Hierarchical Forcing
Forcing statements permit the modification of the SFC state. They are used to impose a
certain situation on an SFC. The forcing statement will run as long as its activation condition
is TRUE.

During simulation, it is possible to force the activation of a step or the passing of a
transition without respecting the SFC syntax. This function must not be confused
with hierarchical forcing.
4.20.1. Using Hierarchical Forcing
The general form for forcing is:
F/ SFC_Name.FORCED:( .SFC_Name.X??.FORCED).
Example: F/.GRA_001.FORCED : (.GRA_001.X01.FORCED, .GRA_001.X10.FORCED).
F/ is the forcing operator;
SFC_Name.FORCED is the name of the SFC that will be forced;
() include the list of steps that will be forced, this corresponds to the desired SFC
situation. One or more steps can be specified for one SFC and must be separated by a
comma. If no step is specified (), all steps of the SFC are deactivated.
During forcing, specified steps are activated and all others deactivated.
Examples of forcing:

Figure 427: Forcing
In this case, the SFC is forced and only steps 4 and 10 are active.
SFC Users Manual
4-30

Figure 428: Conditional forcing
In this example, the SFC is forced so that only steps 4 and 10 are active as long as the Stop
variable is TRUE.

Figure 429: Forcing to an empty situation
In this example, SFC GRA_001 is forced to an empty situation so that all of its steps are
deactivated. To reactivate the initial step, the SFC must be reinitialized (GRA_001.INIT).
4.20.2. Rules on Hierarchical Forcing
An SFC cannot force itself.
An SFC cannot force another SFC on the same hierarchical level.
An SFC cannot force another SFC on a higher hierarchical level.
Two SFCs on the same hierarchical level cannot force the same SFC.
If an SFC if forced by two SFCs of higher and different hierarchical levels, all the
specified steps in both instructions are forced. The last active instruction will determine
the state of the SFC when the instruction is deactivated.
An SFC can be forced even if it isnt running. (see 4.18 Managing SFC States and
Faults).
The following figures depict legal and illegal forcing actions:
SFC Syntax
4-31
Automatism X, order of legal forcing
LEVEL SFC
6
5
4
3
2
1
0 G0
G8
G9
G7
G4
G6
G5
G3 G2
G1
G10

Figure 430: Legal forcing
Automatism X, order of illegal forcing
Level SFC
6
5
4
3
2
1
0 G0
G8
G9
G7
G4
G6
G5
G3 G2
G1
G10

Figure 431: Illegal forcing

5-1
5. Simulation
This chapter regroups the particularities associated to the simulation of SFCs. Its purpose is to
familiarize the reader with the simulation mode of the workshop. For the various commands
related to the simulation of a project or a schematic, see the simulation functions in the User's
Guide.
5.1. State of an SFC During Simulation
During simulation, all states of an SFC having the logical value TRUE are displayed in the
head banner of the schematic. These states disappear from the banner when FALSE.

Figure 51: An SFC's states during simulation
SFC State during
simulation
SFC Users Manual
5-2
5.2. Step and Transition States During
Simulation
The following is a state representation of steps during simulation.
An active step is represented by a fixed red square.

Figure 52: Initial step in an active state
A forced step is displayed as a flashing red square.

Figure 53: Forced active step
An active macro step is displayed as a red rectangle in the upper part of the step symbol.

Figure 54: Active macro step
An active macro step, while the exit step of a macro step SFC is active, is displayed as a red
rectangle in the lower part of the step symbol.

The entry step of a macro step SFC is activated simultaneously with the macro step
of the parent SFC. It consists in fact of an implicit AND divergence.

Figure 55: Active entry step
Simulation
5-3

The exit step of a macro step SFC is deactivated simultaneously with the macro step
of the parent SFC. It consists in fact of an implicit AND convergence.

Figure 56: An active exit step

When a step with a break point is activated, the simulation is suspended including all
concurrent temporizations. When the step number is locked, it is not renumbered if
the renumbering function is executed.

Figure 57: Step with break point and locked number
Here is the state representation of transitions during simulation:

Figure 58: Transition that can be validated during simulation
A transition with a TRUE validated transition condition.

The validation of a transition is a very ephemeral state that can only be visualised
through a step by step simulation.

The variables manager makes it possible to visualise in real time the current value of
each variables of an SFC. See the Variable Manager in the Users Guide.
SFC Users Manual
5-4
5.3. Fault Management During Simulation
5.3.1. Sequence Duration Surveillance
One sequence duration corresponds to the time elapsed between the deactivation and
reactivation of the initial step of an SFC.
Sequence duration surveillances are activated automatically when time limits have been
defined in the properties of an SFC.

Sequence duration surveillance can only be applied to SFCs designed with only one
initial step or, in the case of macro steps, with only one entry step. Also, the initial
step has to be numbered with the no. 1 step in the SFC.
5.3.1.1. Minimum Sequence Duration Fault
The elapsed time is cumulated once the SFC has started (RUNNING) and is currently running
(RUN). An SFC is considered started (RUNNING) once its initial step is not active. The
elapsed time is reset to zero (0) when the initial step is reactivated (X01.X), or the SFC is
reinitialised (INIT). If the SFC returns to its initial step within a minimum time delay, an
internal fault is generated and maintained until it is acknowledged.
For this surveillance, we use the following internal variables:
SEQ_TMIN: Minimum time delay of one SFC sequence. This time delay can be adjusted
through the SFC's properties.
SEQ_MIN_FAULT: Minimum sequence duration fault.
SEQ_MIN_ACK: Acknowledgement command for the minimum sequence duration
fault.
SEQ_MIN_ACQ_MEM: Acknowledgement memory of the minimum sequence duration
fault.
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the minimum sequence duration
surveillance:
Acknowledgement memory for the minimum sequence duration fault.
Simulation
5-5
SFC_Name.SEQ_MIN_ACQ_MEM IF SFC_Name.SEQ_MIN_ACK
OR
(SFC_Name.SEQ_MIN_ACQ_MEM
AND SFC_Name.SEQ_MIN_FAULT)
Detection of the minimum sequence duration fault.
SFC_Name.SEQ_MIN_FAULT IF: (SFC_Name.RUNNING AND NOT
SFC_Name.SEQ_TMIN_Q AND X01.X
AND NOT INIT)
OR
(SFC_Name.SEQ_MIN_FAULT AND
NOT
SFC_Name.SEQ_MIN_ACQ_MEM)

For visual acknowledgement purposes, this fault can be assigned to a display light in
the Electrical workshop. This assignation can be done inside an SFC or a structured
text.

A push button in the Electrical workshop can be assigned to an acknowledgement
command of the fault. This assignation can be done inside an SFC or a structured
text.
5.3.1.2. Maximum Sequence Duration Fault
The elapsed time is cumulated once the SFC has started (RUNNING) and is currently running
(RUN). AN SFC is considered started (RUNNING) once its initial step is not active. The
elapsed time is reset to zero (0) when the initial step is reactivated (X01.X), or the SFC is
reinitialised (INIT). If the SFC returns to its initial step after a maximum time delay, an
internal fault is generated and maintained until it is acknowledged.
For this surveillance, we use the following internal variables:
SEQ_TMAX: Maximum time delay of one SFC sequence. This time delay can be
adjusted through the SFC's properties.
SEQ_MAX_FAULT: Maximum sequence duration fault.
SFC Users Manual
5-6
SEQ_MAX_ACK: Acknowledgement command for the maximum sequence duration
fault.
SEQ_MAX_ACQ_MEM: Acknowledgement memorization of the maximum sequence
duration fault.
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the maximum sequence duration
surveillance:
Acknowledgement memorization for the maximum sequence duration fault.
SFC_Name.SEQ_MAX_ACQ_MEM IF SFC_Name.SEQ_MAX_ACK
OR
(SFC_Name.SEQ_MAX_ACK_MEM
AND SFC_Name.SEQ_MAX_FAULT)
Detection of the maximum sequence duration fault.
SFC_Name.SEQ_MAX_FAULT IF SFC_Name.SEQ_TMAX_Q
OR
(SFC_Name.SEQ_MAX_FAULT AND
NOT
SFC_Name.SEQ_MAX_ACK_MEM)

For visual acknowledgement purposes, this fault can be assigned to a display light in
the Electrical workshop. This assignation can be done inside an SFC or a structured
text.

A push button in the electrical workshop can be assigned to an acknowledgement
command of the fault. This assignation can be done inside an SFC or a structured
text.
5.3.2. Step Duration Surveillance
One step duration corresponds to the time elapsed between the activation and deactivation of
the step.
Step duration surveillances are activated automatically when time limits have been defined in
the properties of an SFC.
Simulation
5-7
5.3.2.1. Minimum Step Duration Fault
For each step under surveillance, the elapsed time is cumulated while the step is active and
the SFC is currently running (RUN). The elapsed time is reset to zero (0) when the step is
deactivated, or if the fault is acknowledged. If the step under surveillance is deactivated
within a minimum time delay, an internal fault is generated and maintained until it is
acknowledged.
For this surveillance, we use the following internal variables:
Xxx.TMIN: Minimum time delay of one step (one delay per step).
STEP_MIN_FAULT: Minimum step duration fault (only one fault for all steps under
surveillance).
STEP_MIN_COND_DEF: Fault condition detected on the preceding transition to the
step under surveillance, within the minimum time delay of the step Xxx.TMIN.
STEP_MIN_ACK: Acknowledgement command for the minimum step duration fault.
STEP_MIN_ACQ_MEM: Acknowledgement memorization of the minimum step
duration fault.
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the minimum step duration
surveillance:
Acknowledgement memorization for the minimum step duration fault.
SFC_Name.STEP_MIN_ACK_MEM IF SFC_Name.STEP_MIN_ACK
OR
(SFC_Name.STEP_MIN_ACK_MEM
AND SFC_Name.STEP_MIN_FAULT)
Detection of the minimum step duration fault.
SFC_Name.STEP_MIN_FAULT IF SFC_Name.STEP_MIN_Y?_COND_FAU
LT
OR
(SFC_Name.STEP_MIN_FAULT AND
NOT
SFC_Name.STEP_MIN_ACK_MEM)
where Y?.COND_FAULT exists for each
preceding transition of a step under
surveillance.
SFC Users Manual
5-8

For visual acknowledgement purposes, this fault can be assigned to a display light in
the Electrical workshop. This assignation can be done inside an SFC or a structured
text.

A push button in the electrical workshop can be assigned to an acknowledgement
command of the fault. This assignation can be done inside an SFC or a structured
text.
5.3.2.2. Maximum Step Duration Fault
For each step under surveillance, the elapsed time is cumulated while the step is active and
the SFC is currently running (RUN). The elapsed time is reset to zero (0) when the step is
deactivated, or if the fault is acknowledged. If the step under surveillance is deactivated after
a maximum time delay has expired, an internal fault is generated and maintained until it is
acknowledged.
For this surveillance, we use the following internal variables:
Xxx.TMAX: Maximum time delay of one step (one delay per step).
STEP_MAX_FAULT: Maximum step duration fault (only one fault for all steps under
surveillance).
STEP_MAX_ACKK: Acknowledgement command for the maximum step duration fault.
STEP_MAX_ACQ_MEM: Acknowledgement memorization of the maximum step
duration fault.
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the maximum step duration
surveillance:
Acknowledgement memorization of a maximum step duration fault.
SFC_Name.STEP_MAX_ACQ_MEM IF SFC_Name.STEP_MAX_ACK
OR
(SFC_Name.STEP_MAX_ACK_ME
M AND
SFC_Name.STEP_MAX_FAULT)
Simulation
5-9
Detection of the maximum step duration fault.
SFC_Name.STEP_MAX_FAULT IF SFC_Name.Xxx.TMAX_Q
OR
SFC_Name.Xyy.TMAX_Q
OR
SFC_Name.Xzz.TMAX_Q
OR
(SFC_Name.STEP_MAX_FAULT AND NOT
SFC_Name.STEP_MAX_ACK_MEM)

For visual acknowledgement purposes, this fault can be assigned to a display light in
the electrical workshop. This assignation can be done inside an SFC or a structured
text.

A push button in the electrical workshop can be assigned to an acknowledgement
command of the fault. This assignation can be done inside an SFC or a structured
text.
5.3.3. General Fault
An SFC's general fault regroups all faults declared in the SFC, plus the external security
condition ESC. The software implicitly supports this grouping in the following manner:
SFC_Name.GEN_FAULT := SFC_Name.STEP_MAX_FAULT
OR
SFC_Name.STEP_MIN_FAULT
OR
SFC_Name.SEQ_MIN_FAULT
OR
SFC_Name.SEQ_MAX_FAULT
OR
SFC_Name.ESC

The external security condition ESC can be assigned inside an SFC or structured
text.
SFC Users Manual
5-10
5.4. Windows Layout
Before switching your first project into simulation mode (SFC_PNEU.PR4 in the directory
EXERCICES of the software) you have to reorganize all windows in such a way that it is
possible to view the operational schematic and the SFC simultaneously.

Figure 59: Window layout
5.5. Project Simulation
To simulate a project:
1. Choose Simulation Project.

You might also like