Automation Sequential Function Chart Guide
Automation Sequential Function Chart Guide
Chart (SFC)
User’s Guide
Famic Technologies Inc. All rights reserved.©
REPRODUCTION
ii
Table of Contents
iv
1 Introduction
Automation Studio™ SFC is a complete automation project specification environment. It is
a direct manipulation graphic editing tool as well as a SFC simulation tool (GRAFCET). The
notation used conforms to the CEI 61131-3 International Standard and to the extension
proposals as defined by the AFCET’s SFC group and by the PR NF EN 60848 standard
projects. Because Sequential Function Chart (SFC) is rapidly becoming the method of
choice to design structured automation controls, the Automation Studio ™ SFC Workshop
provides all of the necessary tools to design operation sequences and to validate a
project prior to implementation, as well as to understand how equipment operates.
This SFC Workshop User’s Guide provides the necessary information to use this workshop
with Automation Studio™. This includes technical specifications for components,
procedures for defining properties, building and simulation of a circuit, and examples of
applications.
Chapter 3 Description of the SFC Editor: This chapter presents the SFC Workshop
environment and describes the editable properties of various SFC components.
Chapter 4 SFC Syntax: This chapter gives a detailed description of the syntax that must be
applied while using SFC components, symbols and processes.
Chapter 5 Predefined SFC Variables: This chapter describes the function and utility of
variables that are automatically created with the creation of a SFC and its components.
Chapter 7 Simulation: This chapter describes the particularities associated with the
simulation of SFCs. Its purpose is to familiarize the user with the simulation mode of the
workshop.
Chapter 8 Export: This chapter describes the different export functions of the SFC
workshop.
1-2
2 SFC Representation
An automation system is generally composed of two independent parts:
• The Operative Part (OP): the system itself, that the user wishes to automate;
• The Command Part (CP): the logical unit that sends OUTPUT signals to the
operative part or other external components, given a set of INPUT signals.
A Sequential Function Chart (SFC) is a graphical formalism that allows the description of
an automation system, using basic SFC components.
2-2
SFC Representation
The templates window is then displayed allowing to select the template to be used for
the Sequential Function Chart document under creation.
By default, there is only one template available, but it is possible for the user to
create his own templates for a Sequential Function Chart document (as well as for
other types of documents or for the project). See Automation Studio™ Common
Features User’s Guide for more information.
After selecting the template and clicking the “OK” button, an “Export Warning” window
pops-up. It displays some limitations that apply only if the SFC document is created in
Automation Studio™ with the aim to be exported to Allen Bradley ladder or Siemens STEP
7 SFC formats. See Chapter 8 Export.
The limitations are generally related to the supported models of PLC, the usable variable
types, the usable operators, the timers and some general limitations.
The content of the “Export Warning” window is listed in details in the following table:
2-4
SFC Representation
Exporting Supported PLC Only the models of SLC 500 and MicroLogix series are
graphs to models supported.
Allen-
Bradley
Ladder
format
• BOOL, SINT and INT for the models: SLC 5/01, SLC
5/02 and SLC 5/03 – OS 300 and MicroLogix 1000;
• BOOL, SINT, INT and REAL for the other SLC 500
and MicroLogix models.
Usable Operators The following operators must not be used: SHL, SHR,
ROL, ROR, BCD_TO_DEC, DEC_TO_BCD, RAD_TO_DEG,
DEG_TO_RAD, SEL, MIN, MAX, LIMIT, MUX and TP.
Exporting Supported PLC Only the 3xx and 4xx models are supported.
graphs to models
Siemens
2-6
SFC Representation
Usable variable All variable types are supported with the following
types limitations:
To avoid showing this window at the creation of every new SFC document, you
can check the box at the bottom of the window.
2-8
SFC Representation
2-10
SFC Representation
2-12
3 Description of the SFC Editor
This chapter covers the SFC editor. All descriptions of other items with common functions
can be found in the Automation Studio™ User’s Guide.
“Links” Group
These items can also be accessed through the contextual menu of a link or a branch. The
last option is also available through the contextual menu of a link or jump.
The “Links” commands of the “Home” tab offers the following options:
Option Description
Convert Link or Converts a Link into a Jump, or vice versa according to the
Jump context.
Base Fit Redraw Redraws the selected branch and its connected links using the
shortest path between the components.
Adjust Redraws the selected branch with a jump using the shortest
path.
“SFC” Group
This grants access to the component insertion tools in the SFC. Components can be
inserted from the ribbon.
Figure 3-5: Options from the “SFC” Group of the “Home” Tab
Option Description
3-2
Description of the SFC Editor
Option Description
Convert Step This converts a standard step into an initial step and vice
versa.
The “Edit” tab options can be found in the Automation Studio™ User’s Guide. In this
workshop, only the “Select” option will be explained.:
Figure 3-7: Options from the “Select” Command of the “Edit” Tab
Option Description
3-4
Description of the SFC Editor
Option Description
The “View” Tab options can be found in the Automation Studio™ User’s Guide.
The “Simulation” Tab options can be found in the Automation Studio™ User’s Guide.
“Diagnosis” Group
“Diagnosis Tools” command allows you to identify errors in the SFC. Error and/or warning
messages are displayed in the Messages Window.
“Tools” Group
“Renumber” command allows to renumber all selected components except those that
are blocked.
These options are also available on a right click on any SFC component.
Option Description
Lock Number This protects the selected item number from being
renumbered. An asterisk indicates a blocked item (see
Figure 3-11: Right click menu of a SFC component)
3-6
Description of the SFC Editor
Option Description
These command buttons and their behaviour information can be found in the Automation
Studio™ User’s Guide.
Figure 3-13: “Automation” → “SFC Standards” Branch of the Project Properties Window,
SFC Standards Management Section
This area allows you to create, delete, copy/paste, rename and comment SFC Standards.
When a new SFC document is created, it will use the SFC Standard set as default.
You can modify the default behavior of the SFC editor with the following tab.
Figure 3-14: “Automation” → “SFC Standards” Branch of the Project Properties Window,
“Edition” tab
Property Description
Auto Jump-to Label on Shows or hides the Jump-to label on the rising links.
Rising Link
3-8
Description of the SFC Editor
Property Description
Component Color Specifies the color of all of the SFC components on the
diagram.
Apply Colors to Syntax Specifies whether or not to apply colors to syntax elements.
Elements
Defined Variable Color Specifies the colors associated with defined variables.
If you wish to see how each option affects the diagram, change any option and
look at the preview in the project properties. The preview is automatically
updated.
You can modify the default behavior of the SFC simulation within this tab.
Figure 3-15: “Automation” → “SFC Standards” Branch of the Project Properties Window,
“Simulation”tab
Property Description
Active Component Specifies the colors used to indicate the active step or
Color transition.
If you wish to see how each option affects the diagram, change any option and
look at the preview in the project properties. The preview is automatically
updated.
3-10
Description of the SFC Editor
types. For further details please refer to the Automation Studio™ User’s Guide.
This dialogue box allows you to set the parameters of the SFC document:
Section Description
Standards A new SFC diagram uses the default standards set in the Project
Properties dialogue. You can then select a different SFC standard for
each SFC diagram within the project.
It’s also possible to import a standard within the SFC diagram. This is
described in the Automation Studio™ User’s Guide.
Parameters This section allows you to modify the SFC diagram’s parameters.
Section Description
SFC Run unconditional running of the SFC.
Source Step The source macro step of the macro step SFC is
defined in this zone.
Min Sequence This option allows you to set a minimum time for
Time the SFC’s sequence.
Max Sequence This option allows you to set a maximum time for
Time the SFC’s sequence.
3-12
Description of the SFC Editor
Section Description
words it displays the state of the variables and it
simulates the flow chart.
Appearance This zone allows you to change some display and editing options.
Zones Description
Add a Variable This button provides access to the “Add a Variable” dialogue box.
For more details on creating variables, see 4.2.6 Variable Types
or the variables section in the Automation Studio™ User’s
Manual.
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 center of
the left side of the exterior frame.
Associated Macro If the step is defined as being a macro step, the associated SFC
Step Graph 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.
Break Point When checked, this option will stop the simulation when the
step has been activated.
Actions This zone is used to edit the different actions associated with the
step. Here, all of the actions associated with a step can be
viewed. 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
3-14
Description of the SFC Editor
Zones Description
separating them with a comma. (ex.: Action1, Action2,
Action3 IF Condition1);
• Write the actions to be executed by using the variables and
operators can be found in the “Syntax and Operators” zone;
• Select the type of display of the used variables, whether by
name or alias.
Time Supervision This zone is used to edit the minimum and maximum
supervision time. The sequence time is calculated from the start
to the return to the initial step.
Comment This button allows you to add comments related to the action.
3.9.1 Actions
3.9.1.1 Statement
This zone contains an interface that allows you to build the formulas for a step, as an
alternative to you directly typing in those formulas. A list of all the variables inside the
project is displayed in the “Variables” zone while every possible action or operator
corresponds to a button in the “Syntax and Operator” zone. The dialogue box displays a
basic form of the formula that is updated whenever the user selects another action.
Zone Description
Statement This zone is used to edit the different actions associated with the
Zone Description
step. The syntax of the actions must follow that described in
chapter 4 SFC Syntax. Here, all of the actions associated with a step
can be viewed. This zone is deactivated for macro steps and out
steps. The user may:
Unconditional This checkbox determines whether the running of the actions of the
Actions step is conditional to the running state of the SFC.
3.9.1.2 Variables
This zone contains an interface that allows you to view all the variables in the project to
be inserted in the statement.
3-16
Description of the SFC Editor
Zone Description
Insert This radio-button allows to select how the variables used in the
Name/Insert “Actions” zone will be displayed: by “Name” or by “Alias”.
Alias
Name This drop-down menu allows to select the field (column) onto
which the filtering criteria should be applied.
« Please type in This field should be filled with the user’s filter criteria.
your criterion »
Table This table displays the variables matching the filtering criteria, all
variables are displayed by default. The variables in the table can be
Zone Description
sorted by clicking on a column.
This zone contains an interface that allows you to select predefined operators. Whenever
the user selects an operator, the basic formula is displayed. Some of the fields of the
formula should be replaced by more appropriate values.
Zone Description
Syntax Describes the operator that has been selected by a left clicking in
the examples list, or in the calculator.
Operators These buttons are used to enter operators in the action statement.
Click on the corresponding button to enter an operator.
More Operators Use this button to gain access to the advanced features of the
operator calculator.
This dialogue allows the user to specify the minimum and maximum activation times for
the step.
3-18
Description of the SFC Editor
Zone Description
Minimum Activation Sets a minimum time for the step’s activation. If the step is
Time (T#0ms) active for a shorter period than the one specified here, the
minimum activation time for the step defaults to TRUE.
(e.g.: STEP_MIN_FAULT)
Maximum Activation Sets a maximum time for the step’s activation. If the step is
Time (T#0ms) active for a period longer than the one specified, the
maximum activation time for the step defaults to TRUE
(e.g.: STEP_MAX_FAULT).
Fields Description
Add a Variable This button provides access to the “Add a Variable” dialogue box.
For more details on creating variables, see the chapter “4.2.6
Variable Types” of this document or the variables section in the
Automation Studio™ User’s Manual.
3-20
Description of the SFC Editor
Fields Description
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.
A transition with no transition condition is considered false. During simulation, only the
contextual menu allows passing a transition with no transition condition.
3.10.1 Conditions
3.10.1.1 Statement
This zone contains an interface that allows you to build the formulas for a transition, as
an alternative to you directly typing in those formulas. A list of all the variables inside the
project is displayed in the “Variables” zone while every possible action or operator
corresponds to a button in the “Syntax and Operator” zone. The dialogue box displays a
basic form of the formula that is updated whenever the user selects another action.
Some of the fields of the formula should be replaced by more appropriate (numerical)
values.
Zone Description
Statement This zone is used to edit the different conditions associated with
the transition. The syntax of the conditions must follow that
described in chapter 4 SFC Syntax. The user may:
Basic equation:
Edited equation:
3.10.1.2 Variables
This zone contains an interface that allows you to view all the variables in the project to
be inserted in the statement.
3-22
Description of the SFC Editor
Zone Description
Insert This radio-button allows to select how the variables used in the
Name/Insert “Conditions” zone will be displayed: by “Name” or by “Alias”.
Alias
Name Use this drop-down menu to select the field onto which the
filtering criteria should be applied.
« Please type This field should be filled with the user’s filter criteria.
your criterion »
Table This table displays the variables matching the filtering criteria, all
variables are displayed by default. The variables in the table can be
sorted by clicking on a column.
This zone contains an interface that allows you to select predefined operators. Whenever
the user selects an operator, the basic formula is displayed. Some of the fields of the
formula should be replaced by more appropriate values.
Zone Description
Syntax Describes the operator that has been selected by a left clicking in
the examples list, or in the calculator.
Operators These buttons are used to enter operators in the action statement.
Click on the corresponding button to enter an operator.
More Operators Use this button to gain access to the advanced features of the
operator calculator.
3-24
Description of the SFC Editor
Zones Description
Add a Variable This button provides access to the “Add a Variable” dialogue box.
For more details on creating variables, see the chapter “4.2.6
Variable Types” of this document or the variables section in the
Automation Studio™ User’s Manual.
Zones Description
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.
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.
3.11.1.1 Statement
This zone contains an interface that allows you to build the formulas for a structured text,
as an alternative to you directly typing in those formulas. A list of all the variables inside
the project is displayed in the “Variables” zone while every possible action and/or
condition or operator corresponds to a button in the “Syntax and Operator” zone. The
dialogue box displays a basic form of the formula that is updated whenever the user
selects another action and/or condition. Some of the fields of the formula should be
replaced by more appropriate (numerical) values.
Zone Description
3-26
Description of the SFC Editor
Zone Description
Statement This zone is used to edit the different actions and/or conditions
associated with the structured text. The syntax of statement must
follow that described in chapter 4 SFC Syntax. 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 the actions to be executed by using the variables and
operators can be found in the Syntax and Operators zone.
3.11.1.2 Variables
This zone contains an interface that allows you to view all the variables in the project to
be inserted in the statement.
Zone Description
Insert This radio-button allows to select how the variables used in the
Name/Insert “Structured Text” zone will be displayed: by “Name” or by “Alias”.
Alias
Name Use this drop-down menu to select the field onto which the
filtering criteria should be applied.
« Please type This field should be filled with the user’s filter criteria.
your criterion »
Table This table displays the variables matching the filtering criteria, all
variables are displayed by default. The variables in the table can be
3-28
Description of the SFC Editor
Zone Description
sorted by clicking on a column.
This zone contains an interface that allows you to select predefined operators. Whenever
the user selects an operator, the basic formula is displayed. Some of the fields of the
formula should be replaced by more appropriate values.
Zone Description
Syntax Describes the operator that has been selected by a left clicking in
the examples list, or in the calculator.
Operators These buttons are used to enter operators in the action statement.
Click on the corresponding button to enter an operator.
More Operators Use this button to gain access to the advanced features of the
operator calculator.
Zones Description
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.
3-30
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:
• Identifiers Naming;
• Constants;
• Operators;
• Operator priority;
• Assignment;
• Syntax Verification;
• Timing;
• Managing SFC States and SFC Faults;
• Macro Steps;
• Forcing Order.
Variable Type
Variable Type
If the SFC diagram is used to control an electropneumatic circuit, a ladder etc., the
BOM of these components should also follow these rules.
4.2.1 Steps
When a new step is inserted, it is assigned a unique number by Automation Studio ™. The
number is used to refer clearly to this step in a given SFC.
Moreover, two new variables are created for every newly inserted step. Those variables
are available to the user:
• One variable represents the logical state of the step; Xn.X;
• One variable keeps track of the total time elapsed in milliseconds since the step
was last activated. For example: Xn.T, n is the step number.
• The IEC 1131-03 international standard specifies that an activation period
4-2
SFC Syntax
Graph_Name.Xn.T/ starts with the rising step Xn. The length of the activation
period is reset to zero only when the step again becomes active after it has been
passive. The elapsed time is a double integer variable that indicates the number
of milliseconds since the last activation.
• You must be careful when the same variable is used by a step and by a
structured text. The actions associated with a step are evaluated in the
sequential order of the SFC, while the structured text is updated with every
simulation cycle.
4.2.2 Transition
A structured text behaves in the same way as an action, with the exception that the
former is not associated with a step. A structured text is updated with every simulation
cycle, after the step-associated actions have been executed.
As for steps and transitions, when a new structured text is inserted, it is assigned a
unique number by Automation Studio™ within the range (1 to 999). The number is used
to unambiguously refer to this structured text in a given SFC.
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 Comment
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.
The SFC workshop has reserved keywords, meaning that they cannot be used as
identifiers.
• Names beginning with X are reserved for steps;
• Keywords “OR, XOR, AND, and NOT” are reserved for the Boolean operators;
• Keywords “F/”, “T/”, “TON/”, “TOF/” and “TP/” 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;
• Keywords “TO_BOOL”, “TO_SINT”, “TO_INT”, “TO_DINT”, “TO_LINT”, “TO_USINT”,
“TO_UINT”, “TO_UDINT”, “TO_ULINT”, “TO_REAL”, “TO_LREAL”, “TO_TIME”,
“TO_DATE”, “TO_TIME_OF_DAY”, “TO_TOD”, “TO_DATE_AND_TIME”, TO_DT”,
“TO_STRING”, “TO_BYTE”, “TO_WORD”, “TO_DWORD”, “TO_LWORD”,
“TO_WSTRING”, “TO_CURRENCY”, “TO_DECIMAL”, “TO_ENUM”, “TO_STRUCT”,
“TO_ARRAY”, “TO_HYPERLINK” are reserved for conversion operators;
• Keyword “IF” is reserved for the conditional operator.
When you insert actions and transitions, the expressions they contain will be
displayed using a different color if the expressions are not syntactically correct.
The variable type depends on the information it contains. There are three main
categories of variable types:
4-4
SFC Syntax
• Basic Types;
• Derived Types, specific to the user or AS;
• Generic Types:
The figure below shows the variables supported by AS6.0, sorted hierarchically.
A description of variable types and their limit values is given in the Variables Manager in
the Automation Studio™ User’s Guide. The following table lists the possible variable types
that can be used for internal logic.
A new variable can be created with the help of the “Add Variable” button found in the
Properties dialogue of steps/transitions/structured texts or from the Variables Manager
window. For more details on creating variables, refer to the Variables Manager in the
Automation Studio™ User’s Guide.
4-6
SFC Syntax
It is possible to create external links (OPC) on variables with the use of the “OPC Client”
tab in the variable manager.. For more details on creating external links, see Variables
manager in the Automation Studio™ User’s Guide.
4.3 Constants
Constants are fixed values that can be of the same type as basic variables. The syntax to
use constants of type ANY_ELEMENTARY in the SFC is:
[TYPE]#[Value]
Examples:
• LREAL#1.1;
• INT#25;
• TIME#1d2h3m4s500ms (d: day, h: hour, m: minute, s: second, ms: millisecond);
• DATE_AND_TIME#2011-01-01-12:59:59 or DT#DATE_AND_TIME#2011-01-01-
12:59:59;
• DATE#2011-12-31;
• TIME_OF_DAY#23:18:35 or TOD#23:18:35.
There is a difference with the ANY_BIT types: it is possible to specify the base (2, 8 or 16)
of the value. If no base is specified, base 10 is used. The syntax is:
[TYPE]#[Base]#[Value]
Examples:
• BYTE#2#1001 or BYTE#9;
• WORD#8#1234 or WORD#668;
• DWORD#16#FFF or DRWORD#65535.
Example:
• “ERROR”
Examples:
• TO_CURRENCY(89.99);
• TO_DECIMAL(0.25).
4.4 Operators
An operator applies a function to one or more real and/or integer variables. All operators,
with the exception of the explicit conversion operators, are given in the table of Annex B.
The “Input” columns indicate the type of variable supported by the operator. The “Output
1” column indicates the type of variable returned by the operator. When a generic type is
indicated for the input and for the output, it means that the input and output variables
have the same basic type. For example the Sine (SIN) operator is compatible with the
ANY_REAL type for input and output. The operator is valid only if the input and output
variables are of type REAL or if they are of type LREAL. If the input is of type REAL and the
output of type LREAL or vice-versa, the expression is invalid. It is however possible to
remedy this problem using the explicit conversion operators (See section 4.13.2 Explicit
Conversion).
The following table describes operator category, operand type and, if needed, a brief
description and/or example.
4-8
SFC Syntax
+ Addition
- Subtraction.
/ Division.
* Multiplication.
These arithmetic operators are used for complex mathematical expressions involving
variables.
The following table describes operator category, operand type and, if needed, a brief
description and/or example.
.Ls1 := SHL(.Ls2,1),
.Ls1 := SHL(.Ls2,.Ls3),
4-10
SFC Syntax
.Ls2 := SHL(.Ls2,.Ls3)
Example :
.B := SHL(.A, 3) = [1 0 1 0 0 0 0 0].
.Ls1 := SHR(.Ls2,1),
.Ls1 := SHR(.Ls2,.Ls3),
.Ls2 := SHR(.Ls2,.Ls3)
Example :
.B := SHR(.A, 3) = [0 0 0 1 0 1 1 0].
.Ls1 := ROL(.Ls2,1),
Rotational left shift of .Ls2 by 1 position, .Ls2 is not modified.
.Ls2 := ROL(.Ls2,.Ls3)
Example :
4-12
SFC Syntax
.B := ROL(.A, 3) = [1 0 1 0 0 1 0 1].
.Ls1 := ROR(.Ls2,1),
.Ls2 := ROR(.Ls2,.Ls3)
Example :
.B := SHR(.A, 3) = [1 0 0 1 0 1 1 0].
INC(.Ls2,.Ls3)
DEC(.Ls2,.Ls3)
4-14
SFC Syntax
Limiter,
Multiplexer
.Ls1:= BCD_TO_DEC(.Ls2)
.Ls1:= DEC_TO_BCD(.Ls2)
.Ls1:= RAD_TO_DEG(.Ls2)
.Ls1:= DEG_TO_RAD(.Ls2)
These operators are used to evaluate logical expressions involving variables. The
returned value is a Boolean.
Operator Description
4-16
SFC Syntax
Operator Description
An edge is a special type of operator, that indicates when a Boolean variable or Boolean
expression changes its value.
There are two types of operators: rising edge operator and falling edge operator. They
are defined in the following table:
Operator Description
^B Rising edge.
or
R_TRIG(B) 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.
! Falling edge.
or
F_TRIG(B) 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.
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 lower than or equal to the
value of B.
< Expression A < B is true if the value of A is lower than the value of B.
<> Expression A <> B is true if the value of A is different from the value of B.
Syntax :
4-18
SFC Syntax
B1 := EXECUTE(H1,S1,…Sn)
Syntax Description
Element
SYCSCR (SFC Synchronous Script, the SFC waits until the end of the Script
to process with next steps)
SCRIPT (SFC Asynchronous Script, the SFC follows its steps while the
Script is running); see the example in the following figure.
SYCMTH (SFC Synchronous Method, the SFC waits until the end of the
Method to process with next steps)
METHOD (SFC Asynchronous Method: the SFC follows its steps while the
Method is running)
Syntax Description
Element
which document the component can be found without having to set its
path. The document’s path does not have to be set.)
ASREF (This general protocol is used to target any object type in any
document. The advantage is its flexibility. On the other hand, the
object’s complete path must be specified. Research is always done
within the documents of a project.)
1. EXECUTE command;
4. First Script Argument: the variable “VarINT” will be converted into a “String”.
4-20
SFC Syntax
• For Steps 2 and 7, the EXECUTE command is using a variable (hyperlink or string);
• For Step 3, the EXECUTE command launch a Method;
• For Step 5, the EXECUTE command launch a Script.
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
() Parenthesis
Operator Priority
*, / Multiplication Operators
+, - Additive Operators
OR Additive Operators
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.
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.
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.
4-22
SFC Syntax
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.
In this example:
• .OUTPUT_COIL is a Boolean variable that is global to the project;
• When step 4 is activated, .OUTPUT_COIL becomes TRUE and will retain that value
until step 4 is deactivated;
• When step 4 is deactivated, .OUTPUT_COIL returns to FALSE.
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 “ :=”.
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.
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”.
In this example:
• When step 4 is active the state of the Boolean variable .OUTPUT_COIL is the same
as the state of the R_TRIG(X1.X) expression;
• When step 4 is inactive, the Boolean variable .OUTPUT_COIL is FALSE.
This type of assignment is done when the specified condition is TRUE. The conditional
numerical assignment operators are: “IF” and “:=”.
In this example:
• When step 4 is active, variable B equals 3 if the expression NOT OUTPUT_COIL is
TRUE;
• When step 4 is inactive, B keeps its last value.
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”.
4-24
SFC Syntax
In this example:
• Variable A equals TRUE when step 5 is active and keeps this value after the
deactivation of step 5;
• Variable B equals FALSE when step 7 is active and keeps this value when step 7
is deactivated.
The Enumeration Assignment allows assigning a value (coming from the list of available
values) to a variable of Enumeration type. To do so, the syntax to use is as follows:
Var := NameEnumerateType#Val
where Var is the name of the variable of Enumeration type, NameEnumerateType is the
Enumeration type name and Val is a specific value coming from the list of values that the
Enumeration type variable can take.
The assignment of “Var1” of “Line_Function” type is done as shown in the figure below.
In this example, the variable “Var1” takes the value “Drain” at the activation of step 2.
This value remains active until the next assignment of the same variable by SFC or
manually.
VarStruct.Component1 := k
where VarStruct is the name of the variable of Structure type, Component1 is the name
of the component of the Structure type variable to which we want to assign a value and
k is the assignment value.
In the following figure, a user-defined Structure type called “SumOfTwoINT” was created.
This type contains three components of “INT” type called “Input1”, “Input2” and
“Output”.
4-26
SFC Syntax
In this example, when the SFC passes to step 12, the “Input1” and “Input2” components
of “Var2” will be equal to 10 and 43 respectively. The “Output” component will be equal
to the sum of the two input components.
The Array Static Assignment allows assigning a specific element of a variable of Array
type. To do so, the syntax to use is the following:
VarArray[a,b] := k
where VarArray is the name of the variable of Array type, a and b are numerical integers
that represent respectively the indexes of the first and second dimension regarding the
variable’s element and k is the value to assign.
The syntax above uses an array of two dimensions. For a three-dimension array,
three numerical integers have to be used inside the brackets to represent the
three dimensions.
The index of each dimension has to be included between the minimum and
maximum indexing value of the dimension. For example, an array of 5*3 can have
an index of 0, 1, 2, 3 or 4 for the first dimension and 0, 1 or 2 for the second
dimension.
In the figure below, a user-defined array called “Table_10_by_4” was created. This type
is an array of 10*4 elements, each of “LREAL” type.
The assignment of the variable “Var3” of “Table_10_par_4” type is done as shown in the
following figure:
In this example, when the SFC passes to step 8, the [0,0] element of “Var3” will take the
value of “10.5”. The [6,2] element will become equal to the sum of the [4,1] and [5,3]
elements and the [9,3] element will become the product of the [8,2] element by 5.
The Array Dynamic Assignment allows assigning an element of a variable of Array type in
a dynamic way by passing the indexes of its dimensions as parameters in the
assignment equation. This is similar to a pointer dynamically pointing to different
elements of a table. To do so, the syntax to use is the following:
VarTable[i,j] := k
where VarTable is the name of the variable of Array type, i and j are integer variables
(where the values are given by the user) that represent respectively the indexes of the
first and second dimension of the variable’s element and k is the value to assign.
4-28
SFC Syntax
The syntax above uses an array of two dimensions. For a three-dimension array,
three numerical integers have to be used inside the brackets to represent the
three dimensions.
The index of each dimension has to be included between the minimum and
maximum indexing value of the dimension. For example, an array of 5*3 can have
an index of 0, 1, 2, 3 or 4 for the first dimension and 0, 1 or 2 for the second
dimension.
In the following figure, we use the variable “Var3” of “Table_10_by_4” type (see Figure
4-18: Example of a user-defined Array). The dynamic assignment is done as shown in the
following figure:
For syntax analysis to be enabled, make sure the option "Apply Colors to Syntax
Elements” is activated in the “SFC Standards” branch, of the “Project Properties” dialogue
box, and that the “Syntax” checkbox is checked in the property dialogue of a step or
transition.. See SFC Standards – Editing Options for more information.
4.8 Timing
When timers are used, their time information is measured using the simulated
time. The simulated time is shown in the status bar when in the simulation mode.
For more information, refer to the Automation Studio™ User's Guide..
Type Description
Timers are Boolean operators that take time into consideration (delay, wait state, etc.).
They are written in the following forms:
• /Xn.X/T#a/;
• TON/Xn.X/T#a/;
• TOF/ Xn.X/T#a/;
• TP/ Xn.X/T#a/.
where:
Characters Description
Xn.X Identifies the input variable, the step or the variable that will
trigger the timer.
ex. : T#30s
where :
4-30
SFC Syntax
Characters Description
day d
hour H
minute M
second S
millisecond ms
Timers can be used to define an action that is delayed, or whose duration is limited.
Timer On-delay
The timing operation TON/Xn.X/T#a evaluates to the Boolean value "1" only when both
the following are true:
• The duration defined by T#a is over;
• The variable Xn.X is active.
The accumulated time is set to zero whenever the variable is inactive. When the variable
is active, the cumulated time increases from zero up to T#a.
Xn.X
Accumulated
Time
TON/Xn.X /T#a/
T#a T#a
Timer Off-Delay
The timing operation TOF/Xn.X/T#a/ evaluates to the Boolean value "1" only when either
The accumulated time increases from zero when the variable becomes inactive, up to
T#a. The accumulated time is reset when the variable is activated.
Xn.X
Accumulated
Time
TOF/Xn.X /T#a/
T#a T#a
The timing operation TP/ Xn.X/T#a/ evaluates to the Boolean value "1" only when the
duration defined by T#a is not complete.
The accumulated time increases from zero when the variable become active, T#a. The
accumulated time is then reset only when the variable is deactivated.
Xn.X
Accumulated
Time
TP/Xn.X /T#a/
T#a T#a
Variables and commands are the inputs given to a SFC. The SFC’s output is a reflection of
4-32
SFC Syntax
the new configuration of its internal states, and new values for its variables.
GEN_FAULT General SFC fault: indicates a fault in the SFC, or the pressing
of ESC.
These states and faults can be used to manage the "RUN" execution mode, the
initialisation (INIT) mode and/or the forcing (FORCED) of the SFC. If this type of variable is
used, a mechanism should be used to warn, then to receive acknowledgement from the
user. For example, a warning light can be used to signal a fault, and a push-button can be
used to acknowledge.
Fault variables cannot be modified. They are listed in the following table:
STEP_MAX_FAULT Maximum step duration fault (only one fault for all steps
under monitoring).
STEP_MIN_FAULT Minimum step duration fault (only one fault for all steps
under monitoring).
4-34
SFC Syntax
The name of the SFC is written in the drop-down menu on the right 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.
4.11 Enclosures
The enclosure is a tool allowing to group (“enclose”) a set of steps, said enclosed, in a
step said enclosing. The enclosure is used to hierarchically structure a sequential function
chart.
The following elements are the main components that can be used in an enclosure:
Symbol Name Description
4-36
SFC Syntax
• The deactivation of the enclosing step leads to the deactivation of all the enclosed
steps in all enclosures of the same enclosing step.
• A standard enclosing step cannot have any enclosure containing an initial step.
• When the enclosing step is also an initial step, each of its enclosures must possess at
least one initial enclosed step that can have an activation link. If the initial enclosed
step possesses an activation link, it is activated at the initial situation, at each
activation of the enclosed step, and according to the enclosure’s evolution; if it does
not, it is activated only at the initial situation and according to the enclosure’s
evolution, but not at the activation of the enclosed step.
Example:
4-38
SFC Syntax
For the first enclosure: Step 1 is an initial enclosed step, it is activated when the
simulation starts and according to the enclosure’s evolution (when it is activated). At
every activation of step 10 except when the simulation starts, step 2 (enclosed step with
standard activation link) is activated.
For the second enclosure: Step 4 is an enclosed step with initial activation link, it is
activated when the simulation starts, at every activation of the enclosing step 10 and
according to the enclosure’s evolution (when it is activated).
When the encapsulating step 10 is deactivated, all the steps of the first enclosure (1, 2,
and 3) and the second enclosure (4, 5, and 6) are deactivated.
It is very easy to use enclosures in Automation Studio TM in order to better structure your
SFC. There are two possible ways to define the step’s type:
• You can select the type before inserting the step. To do so, you can click on the
“Step” command in the “SFC” group of the “Home” ribbon, select the desired step
type and insert it on your SFC document.
4-40
SFC Syntax
The “Enclosing Step” drop-down list is available only if the selected class is
“Enclosed”. Besides, this list, when available, detects automatically all the
enclosing standard and initial steps of all the project’s SFC documents.
Several SFC documents of “Enclosed” class of the same project can be associated
to the same enclosing step. In other words, several enclosures can be enclosed by
the same enclosing step.
In the above figure, the “SFC2” document of the “Sample1” project is an enclosure (its
class is “Enclosed”). Its enclosing step is “X2” in the “SFC3” document of the same
project.
F/ SFCn.FORCED:(.SFCn.Xn.FORCED…),
where,
F/ Forcing Operator
During forcing, specified steps are activated and all others deactivated.
4-42
SFC Syntax
As a general rule, the valid implicit conversions are the ones that do not result in the loss
of information because the storage capacity of the output variable is higher than that of
the input variable.
Examples:
Converting a variable “Var_Int” of type INT to the variable “Var_Real” of type REAL: Valid
Var_Real := Var_Int;
Converting a variable “Var_Real” of type REAL to the variable “Var_Int” of type INT: Invlid
Var_Int := Var_Real
Examples:
According to the value of the input variable, there can be a loss of information and each
operator manages it according to the type of the input variable and to the rules shown in
Annex C.
In the case of the following equation, where “Quantity” is a variable of type INT:
Quantity := Quantity + 1;
This equation is invalid. This is normal, because the first input variable “Quantity” is of
type INT; the second input variable “1” is also of type INT. According to the table in
Annex B, in the “Basic Arithmetic Operator Expressions” section (the line with operators
“+,-,*,/”), if the two input variables are of type INT, the output variable is of type DINT,
which is not the case in this equation. In order to remedy this problem, we can write
instead:
Quantity := TO_INT(Quantity + 1).
4-44
5 Predefined SFC Variables
Some variables are automatically created with a new SFC, and when new components
are inserted.
These variables are either readable and/or writable, and are available in both the
simulation and edition modes.
The Boolean variables that are automatically created with a SFC are listed below :
Variable Description
FORCED Signals that a SFC is forced if any of its steps is forced. This
step must not depend on RUN.
Variable Description
GEN_FAULT := SEQ_MIN_FAULT OR
SEQ_MAX_FAULT OR
STEP_MIN_FAULT OR
STEP_MAX_FAULT OR ESC
A General SFC fault does not trigger a fault. The user can
use these states to RUN, INIT or FORCE the SFC.
For example :
.SFC1.ESC IF EMERGENCY_STOP
5-2
Predefined SFC Variables
Variable Description
RUN The RUN command authorizes the evolution of the SFC and
the execution of the actions associated with its steps.
STEP_MAX_ FAULT Maximum step duration fault (only one fault for all steps
under monitoring).
Variable Description
STEP_MIN_ FAULT Minimum step duration fault (only one fault for all steps
under monitoring).
Every SFC document uses these variables. When a variable is used, it must be
assigned to a specific SFC. It is important to display the ‘‘Location’’ column that
shows the document name associated to the variable.
When the ‘‘Location’’ column displays a dot (.) for a variable instead of a
document name, it means that the actual variable does not belong to any
document but is only related to the project.
The ‘‘Options’’ button gives access to the setup window for columns, popups and
command settings. For more information, refer to Automation Studio ™ User’s
Guide.
5-4
Predefined SFC Variables
The variables (n is the step number.) automatically created with a component are listed
below :
Create a new project in which you will build a circuit identical to the one of Figure 6-1:
Sample pneumatic/electric circuit included in the previously opened project. You could
copy and paste the circuit into your new document. Give the components the same
names as in the original file.
For clarity, we will only use the pneumatic circuit in this guide.
Tagnames for the solenoids are assigned after the internal SFC variables have
been created.
The circuit moves a mass from level 1 to level 2, and places it in either the left or right
bin, according to its weight. The whole process is composed of three steps:
1. The extension of the piston rod in cylinder A moves the mass up;
2. The extension of the piston rod in cylinder B pushes the mass on level 2;
3. A clockwise or counterclockwise rotation of the motor puts the mass in either bin.
1. Start; BP_1;
It is the SFC’s responsibility to generate these commands and to control the process.
1. Click on the AS logo and in AS’s menu, select the “New” → “Sequential
function Chart” item,
OR
2. Choose the "Home" tab in AS’s toolbar, then click on the "New Document" button
and select "Sequential Function Chart" in the dropdown menu.
6-2
Creation of a First SFC
3. Select the SFC Template and press “OK” to close the dialogue box. Automation
Studio™ will create a new SFC document.
6-4
Creation of a First SFC
A component from the SFC Workshop can only be connected to a component from
the same Workshop.
1. On the “Home” tab of AS’s toolbar, click on "Initial Step" of the SFC Group;
2. Move the mouse pointer on the SFC document where you wish to place the new
step, and left-click; the initial step would be created.
1. On the “Home” tab of AS’s toolbar, click on "Insert Transition Step" in the SFC
Group;
3. Once both connectors are overlapping (initial step output and transition
connector), left-click. Right-click to cancel the insertion tool;
6-6
Creation of a First SFC
To avoid erasing the equations already in the "Statement" field with a new
instruction, make sure the cursor is correctly positioned on the field.
a. Find the variable A_IN in the list of variables;
b. Double-click on the variable to insert it in the "Statement" field;
Note that the new variable added is « P21.TransmitterB ». This variable is
the same as A_IN because P21 is the internal identifier used by Automation
Studio™ for A_IN (the number may differ from 21) and TransmitterB is the
transmitter internal variable name.
c. Expand the “Syntax and Operators” zone;
d. Click the "AND" button;
e. Find the variable B_IN in the list of variables;
f. Double-click on the variable;
g. Click the "AND" button in the “Syntax and Operators” group ;
h. Find the variable BP_1in the list of variables;
i. Double-click on this variable;
The equation is now complete. It will be displayed in the "Statement" field
as follows:
7. Click on the icon to apply changes and close the "Component Properties
(Transition – SFC)".
1. On the “Home” tab of AS’s menu, click on "Insert Standard Step" ( ) in the SFC
Group;
2. Move the mouse pointer to the output connector of transition 1. Once the upper
connector from Step 2 is overlapping the lower connector of transition 1, left-
click;
3. Do a mouse right click to quit the step insertion mode. Double left click to open
the “Component Properties (Step –SFC)” dialogue box.
6-8
Creation of a First SFC
The equation is now complete. It should be displayed in the "Statement" field. Click in the
bottom Comment Zone and type:
OUT_A IF BP_1
After a symbol such as a step or a transition has been inserted into the SFC, it is
possible to edit its properties with a double-click on it. The Component Properties
dialogue box will open.
Using the steps described in the two previous sections, insert all the transitions and steps
into the SFC.
Do not forget to create the following variables: OUT_B (step 3), OUT_C (step 7),
IN_A (step 4), IN_B (step 5) et IN_C (step 8) as it was done in step 4 of the
previous section.
2. Click on the button « T/ » in the group « Syntax and Operators ». The syntax
« T/Xn.X/T#a/ » is added to the « Conditions » first zone;
6-10
Creation of a First SFC
If a component is not inserted on a connector, you must manually link it with another
component.
6-12
Creation of a First SFC
The shape of the link is automatically defined by Automation Studio. To edit the
shape of the link, see the Layout of Links section in the Automation Studio™ User’s
Guide.
Creating a branch is not more difficult than creating a regular link. Indeed, a regular link
is automatically converted into a branch according to a set of rules.
To create a divergence, you need a SFC with a configuration that is similar to the one
below:
6-14
Creation of a First SFC
3. You can now link all other components in order to reach the following SFC.
6-16
Creation of a First SFC
To connect transitions 6 and 8 with step 1, connect output connectors of transition6 and 8
to the input connector of the step 1.
Structured Texts represent autonomous actions that are not associated to a step. These
actions are executed when the simulation is active. Structured texts use the same
command syntax as the one used for steps and transitions.
1. On the “Home” tab of AS’s menu, click on "Insert Structured Text" ( ), in the
SFC Group;
2. Move the mouse pointer where you wish to place the new structured text and
left click;
7. Enter a comment in the appropriate field. For instance, Unconditional SFC run;
6-18
Creation of a First SFC
To insert a comment:
1. On the “Home” tab of AS’s menu, click on "Insert Comment" in the SFC
Group;
2. Move the mouse pointer where you wish to place the new comment. Left click;
5. For our example, enter Building a first SFC in the "Comment" field;
6. Click on the icon to apply changes and close the dialogue box.
When the SFC is done, solenoids of the 3 valves A, B and C of the pneumatic diagram
must be linked with variables IN_A, OUT_A, IN_B, OUT_B, IN_C, OUT_C controlled by the
SFC.
For the valve A, there is a need to link the left solenoid with the variable OUT_A and the
right one with the variable IN_A. To do so:
2. Select the right solenoid (SOL1) and click on the Group “Variable Assignment”;
3. Highlight the line of the Variable Alias OUT_A in the list “Compatible simulation
variables”;
4. Click on the button to create an association between the variable and the
component ;
6. Repeat these steps to link the variable IN_A to the right solenoid on the same
valve.
Both solenoids of the valve are now linked with corresponding variables.
6-20
Creation of a First SFC
Link variables the same way for other solenoids of the valves and cylinders, as shown on
the following diagram:
The "Diagnosis Tool" command is accessible from the “Sequential Function Chart” tab of
AS’s menu. It allows you to identify components that are not linked, transitions without
receptivity, illegal equations, etc. These errors are displayed in a "Messages" window.
6-22
7 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 Automation Studio™ User's Guide.
7-2
Simulation
The variables manager makes it possible to view in real time the current value of
each variables of an SFC. See the Variable Manager in the Automation Studio™
User’s Guide.
Every SFC document uses the variables presented in the following section 7.3.
When a variable is used, it must be assigned to a specific SFC. It is important to
display the ‘‘Location’’ column that shows the document name associated to the
variable.
One sequence duration corresponds to the time elapsed between the deactivation and
reactivation of the initial step of an SFC.
Sequence duration monitoring is activated automatically when time limits have been
defined in the properties of an SFC.
Sequence duration monitoring 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.
The elapsed time is cumulated once the SFC has started (“RUN”) and is currently running
(“RUNNING”). A SFC is considered active (“RUNNING”) once its initial step is not active.
The elapsed time is reset to zero (0) when the initial step is reactivated X1.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.
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the minimum sequence
duration monitoring:
• Acknowledgement memory for the minimum sequence duration fault.
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.
7-4
Simulation
The elapsed time is cumulated once the SFC has started (“RUN”) and is currently running
(“RUNNING”). A SFC is considered active (“RUNNING”) once its initial step is not active.
The elapsed time is reset to zero (0) when the initial step is reactivated X1.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.
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the maximum sequence
duration monitoring:
• Acknowledgement memorization for the maximum sequence duration fault.
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.
One step duration corresponds to the time elapsed between the activation and
deactivation of the step.
Step duration monitoring is activated automatically when time limits have been defined
in the properties of an SFC.
For each step under monitoring, the elapsed time is cumulated while the step is active
and the SFC is currently running “RUNNING”. The elapsed time is reset to zero (0) when
the step is deactivated, or if the fault is acknowledged. If the step under monitoring is
deactivated within a minimum time delay, an internal fault is generated and maintained
until it is acknowledged.
1. STEP MIN FAULT: Minimum step duration fault (only one fault for all steps
under monitoring).
2. STEP MIN ACK: Acknowledgement command for the minimum step duration
fault.
7-6
Simulation
The following equations are generated automatically and processed implicitly by the
software. These variables represent the parameterization for the minimum step duration
monitoring:
• Acknowledgement memorization for the minimum step duration fault.
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.
For each step under monitoring, the elapsed time is cumulated while the step is active
and the SFC is currently running “RUNNING”. The elapsed time is reset to zero (0) when
the step is deactivated, or if the fault is acknowledged. If the step under monitoring is
deactivated after a maximum time delay has expired, an internal fault is generated and
maintained until it is acknowledged.
1. STEP MAX FAULT: Maximum step duration fault (only one fault for all steps
under monitoring).
2. STEP MAX ACKK: Acknowledgement command for 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
monitoring:
• Acknowledgement memorization of a maximum step duration fault.
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
7-8
Simulation
structured text.
An SFC's general fault “GEN_FAULT” regroups all faults declared in the SFC, plus the
external security condition “ESC”. The software implicitly supports this grouping in the
following manner:
1. Click on the simulation button. The SFC is started and the initial step 1 is
activated;
6. Click on M_A or M_B to send the load in the left or right containers. Step 1 is now
reactivated. If the Push Button PB_1 is clicked again, another load can be
processed.
7-10
Simulation
The SFC editor does not analyse logic errors while an SFC is edited. It limits itself to
identifying transitions and steps that have their inputs and/or outputs linked to no other
elements in the SFC. In other words, the editor allows creating any SFC imaginable, but
with the resulting SFC being not necessarily functional.
The editor detects syntax errors related to the steps, the transitions and the structured
text. Faulty elements are highlighted in a distinctive colour.
After a simulation is started, error and/or warning messages can appear in the Messages
window, but the simulation is carried on. If one of the actions declared in a step is
erroneous, all the actions of that step are ignored. If the transition condition in a
transition is erroneous or missing, it is always considered as FALSE. If a structured text is
erroneous, it is ignored.
7-12
8 Export
This chapter presents the different export functions of SFC documents created in
Automation StudioTM. Its purpose is to familiarize the user with the various export options
available.
The export functions are accessible through the “Export…” command of the Automation
Studio™ menu.
This command opens the “Export-Format Selection” dialogue window that offers different
export formats. The formats compatible with SFC documents are listed in the “SFC” and
the “Ladder” Groups. For the other export formats, please refer to Automation Studio™
Common Feautures User’s Guide.
The “SFC” group offers two format types for SFC documents: Export (GIE) and Siemens
STEP 7 (3xx and 4xx).
When the “Import / Export SFC (GIE)” checkbox is checked, click on the “Next >” button to
open the “Export-Document selection” dialogue window to select the SFC document to be
exported.
8-2
Export
The dialogue window contains all the SFC documents from the project’s treeview with a
checkbox at the left of each document name. When the Project box is checked, all the
SFC document checkboxes are automatically checked.
Click on the “Finish” button to open the “Export as” dialogue window to select the
location and name of the document to be exported.
The “Cancel” button will end the process without exporting any document(s).
8.2.1 Conditions
Certain verifications are launched at the beginning of the export process (see the “Export
Warning” window in section Figure 2-4: “Export Warning” Window).
Furthermore, Automation Studio™ verifies certain errors blocking the export of the SFC. If
at least one of these errors is detected, a warning dialogue box appears on screen and
the error is displayed in the Message Explorer.
When the “Siemens STEP 7 (3xx and 4xx)” box is checked in the “Export-Format
selection” (see Figure 8-2: “SFC” Group of the “Export-Format Selection” Dialogue ), a
click on the “Next >” button launches a number of dialogue windows that allow at the
end to export the SFC document(s). The first window is the “Export-Document selection”
dialogue window to select the SFC documents to export.
This window allows the user to check the boxes of the current project’s SFC document(s)
to be exported.
A click on the “Next >” button opens the following window that contains the S7
exporting options.
8-4
Export
This window gives the user the possibility to select the organization block source format
and the index ranges or to choose the default ranges by checking the “Use default block
index ranges” box.
A click on the “Next >” button opens the following dialogue window allowing to select
the destination directory for export.
Item Description
Export to Directory: Data field to input the destination directory for the files
to be exported.
8-6
Export
Item Description
At the end of the export process, the following files will be created in the export folder:
File Description
01_SYMBOLS.ASC This file contains the operand fields and the blocs used
in the exported graphs (Q, I, M, FC, FB, DB, SFC, SFB and
OB).
02_BLOCKS.SCL This file contains the function and data blocks associated
with the graphs. It contains also the DB1 data bloc.
File Description
The numerical prefixes in the name of the exported files are important to tell the
user the compilation order. Compilation must be done in an ascending order (from
01 to the highest value). When several bloc or graph files are generated, the
numerical prefixes are automatically adjusted in order to correctly represent the
compilation order.
8-8
Export
The user selects the SFC document(s) that should be exported, then clicks on the “Next >”
button.
The “PLC” group allows selecting the PLC model, processor, rack and I/O modules.
The “Generating Ladder” group allows the user whether to include or not the steps
forcing logic in the resulting file’s ladder code.
8-10
Export
Then, a click on the “Finish” button will generate the resulting export files in the selected
export directory.
An action is an expression that is executed when the step is active. It is an output order
from the command part to the operative section. Actions are composed of expressions,
assignment operators and command operators.
Active step
An active step (standard or initial) is identified by a red token in the middle of the step
symbol.
An active macro step is identified by a red token positioned on top or bottom of the
symbol. The token will be positioned on the bottom of the macro step if the out step of
the parent SFC is active.
A red token on the bottom of the symbol identifies an active out step.
Alphanumeric
AND Convergence
Link between the outputs of at least two steps and the input of a single transition. By
definition the AND convergence is a part of the transition.
AND Divergence
Link between the output of a single transition and the inputs of at least two steps. By
definition the AND divergence is a part of the step.
Automatism
Component
Basic elements used for creating diagrams. Each component represents a behavior or a
function that is functioning during simulation. Components are part of the Library and are
provided by the workshops.
Connection
A connection binds two components and/or links them together. Connections are the
same colour as the element if they are connected, different if not connected. Two
connections from non-compatible technologies cannot be connected together. For
example, a pneumatic line cannot be connected to an SFC component and vice-versa.
Connection Number
Connector
Element represented by a red circle when it is not linked. It allows the connection of two
components. A connector becomes a connection as soon as it is connected to another
element.
Diagram
Diagram Editor
Tool used to create, modify and manage project files. The project editor includes the
document manager that enumerates all the documents in the project.
A-2
Glossary
Display Tools
Designates the design accessories in the Diagram Editor: grid, rulers, connections and
connection numbers. You can specify how they are displayed from the “View” menu.
Edge
Indicates when a Boolean variable passes from one value to the other (0 to 1 or 1 to 0).
Edges can be falling or rising.
Edit Mode
ESC
External Security Conditions that render the running of the SFC useless or dangerous. This
condition is used to signal the SFC general fault.
Forcing Statement
SFC command which forces a graph to assume a certain situation with active and inactive
steps. Forcing statements stay active as long as their condition is TRUE.
GEN_FAULT
Signals an SFC general fault (SFC_name.GEN_FAULT). This signal regroups all graph faults
(minimum sequence duration, maximum sequence duration, minimum step duration,
maximum step duration) and external security conditions (ESC).
Grid
Horizontal and vertical dotted lines located in the workspace of the editor, used to align
the elements of the graph.
Hierarchical Level
INIT
Initialization command of an SFC (SFC_Name.INIT) that activates the SFC's initial steps and
deactivates all others.
Initial step
Step that is active when the SFC is in an initial situation. The symbol of an initial step has
a double border. It is inserted with the use of the Initial Step button in the SFC toolbar.
In Step
Library
Window containing the basic elements used for designing circuits or simulation models.
There are three types of elements: components, links and graphic objects. They are
included in the workshops.
Link
Link shape
Macro Step
The macro step is symbolized by a number in a square with rectangles on both the top
and bottom. It is inserted with the use of the Macro Step button in the SFC toolbar. A
Macro step is a series of steps/transitions graphically condensed to a single step. It is
associated to the SFC that it triggers.
Menu Bar
A horizontal bar located above the application title bar. The menu bar displays the
A-4
Glossary
various menus and commands that are available for the active window.
OR Convergence
Link between the outputs of at least two transitions and the input of a single step. By
definition the OR convergence is a part of the step.
OR Divergence
Link between the output of a single step and the inputs of at least two transitions. By
definition the OR divergence is a part of the transition.
Out Step
The In step is represented by a number inside a square with a rectangle on the bottom. It
is inserted with the use of the Out Step button of the SFC toolbar. It is used in the SFC
that triggers the macro step.
Project
Project Explorer
Content of one of the project editor's windows. The document manager lists all of the
documents in the project.
Project Label
Properties
RUN
SFC evolution permission. Without this permission, the SFC is frozen and no steps or
transitions are processed.
Time span between the deactivation and reactivation of the initial step of the SFC. When
this functionality is used, a fault is generated if the SFC reverts too slowly to its initial
step status. This fault must be acknowledged and acquitted.
Time span between the deactivation and reactivation of the initial step of the SFC. When
this functionality is used, a fault is generated if the SFC reverts too quickly to its initial
step status. This fault must be acknowledged and acquitted.
SFC
Sequential Function Chart (SFC). Graphic representation using basic SFC components used
to represent an automatism.
Simulation Cycle
One step in the calculation that determines the state of each component.
Simulation Mode
Status Bar
Horizontal bar located at the bottom of all of the utility windows. It contains various
types of information such as error messages, zoom factor, mouse pointer coordinates,
etc.
Step
SFC element which, when active, executes the actions associated to it. It is represented
by a number in a rectangle. It is inserted with the use the Step button in the SFC toolbar.
Time span between the activation and deactivation of a step. When this functionality is
A-6
Glossary
used, a fault is generated if the step remains active for too long. This fault must be
acknowledged and acquitted.
Time span between the activation and deactivation of a step. When this functionality is
used, a fault is generated if the step is deactivated too quickly, a Step Minimum Duration
default is generated for the SFC. This fault must be acknowledged and acquitted.
Timers
Timers are processes that produce Boolean results using time such as delay, wait, dead
time, etc. as a parameter. The timers used in SFC refer to steps and variables.
Title Bar
Horizontal bar located at the top of a window that contains the title of the window.
Toolbar
A bar located under the menu bar. It contains buttons for the most frequently used
commands.
Transition
Transition Condition
User Interface
Environment made up of windows, dialogue boxes, graphic objects, etc., with which the
user communicates with the software.
Utility
Worksheet
Workshop
A module that plugs into the Core System. Each workshop contains elements, diagrams
and functions relating to its own technological specialty and to the type of diagrams it
can generate.
A-8
B Variable Operators
B-2
Variable Operators
B-4
Variable Operators
To
DATE_AND_TIME
TIME_OF_DAY
HYPERLINK
CURRENCY
From
WSTRING
DECIMAL
STRUCT
DWORD
LWORD
STRING
ARRAY
LREAL
WORD
UDINT
USINT
ULINT
ENUM
BOOL
DATE
REAL
BYTE
TIME
DINT
UINT
SINT
LINT
INT
BOOL I E8 E16 E32 E64 E8 E16 E32 E64 ER EL LS E8 E16 E32 E64 LW
SINT B I ES16 ES32 ES64 I ES16 ES32 ES64 ISR8 ISL8 VT LS I E16 E32 E64 LW ES64 D X
INT B T8 I ES32 ES64 T8 I ES32 ES64 ISR16 ISL16 VT LS T8 I E32 E64 LW ES64 D X
DINT B T8 T16 I ES64 T8 T16 I ES64 ISR32 ISL32 VT LS T8 T16 I E64 LW ES64 D X
USINT B IS ES16 ES32 ES64 I E16 E32 E64 IR8 IL8 VT LS I E16 E32 E64 LW ES64 D X
UINT B T8 IS ES32 ES64 T8 I E32 E64 IR16 IL16 VT LS T8 I E32 E64 LW ES64 D X
UDINT B T8 T16 IS ES64 T8 T16 I E64 IR32 IL32 VT LS T8 T16 I E64 LW ES64 D X
TIME TV TV TV TV TV TV TV TV TV TV I LS LW
DATE I XTD LS LW
TIME_OF
I XDT LS LW
_DAY
DATE_AND
XD XT I LS LW
_TIME
STRING SL SL SL SL SL SL SL SL SL SL SL SL SL SL SL I SW SL SL
BYTE T1 I E16 E32 E64 I E16 E32 E64 I E16 E32 E64
WSTRING WL WL WL WL WL WL WL WL WL WL WL WL WL WL WL WS I WL WL
DECIMAL TD8 TD16 TD32 TD64 TD8 TD16 TD32 TD64 MR ML LS LW TD64 I
STRUCT X
ARRAY
HYPERLINK
B : If the value is Zero, the boolean takes value 0. If not, it takes value 1
BSL : The litteral value contained in VT_BSTR is converted into the desired format. If the value does not correspond to the
desired format or if it is too large, an error is generated
BSS : Conversion of VT_BSTR into STRING; the most significant byte is truncated
BVB : If the value is Zero, the boolean takes value 0; if not, it takes value 0xFFFF
IL16 : Conversion of INT into LREAL with loss of precision. See [IEC_60559/IEE_754]
IL32 : Conversion of DINT into LREAL with loss of precision. See [IEC_60559/IEE_754]
IL64 : Conversion of LINT into LREAL with loss of precision. See [IEC_60559/IEE_754]
IR16 : Conversion of INT into REAL with loss of precision. See [IEC_60559/IEE_754]
IR32 : Conversion of DINT into REAL with loss of precision. See [IEC_60559/IEE_754]
IR64 : Conversion of LINT into REAL with loss of precision. See [IEC_60559/IEE_754]
ISL16 : Conversion of INT into LREAL with loss of precision. See [IEC_60559/IEE_754]
ISL32 : Conversion of DINT into LREAL with loss of precision. See [IEC_60559/IEE_754]
ISL64 : Conversion of LINT into LREAL with loss of precision. See [IEC_60559/IEE_754]
ISR16 : Conversion of INT into REAL with loss of precision. See [IEC_60559/IEE_754]
ISR32 : Conversion of DINT into REAL with loss of precision. See [IEC_60559/IEE_754]
ISR64 : Conversion of LINT into REAL with loss of precision. See [IEC_60559/IEE_754]
L : Conversion into REAL or VT_R4 with rounding. See [IEC_60559/IEE_754] ; if the value is too large, an error is generated
M8 : The value corresponding to the integer part is truncated to keep the 8 most significant bits
M16 : The value corresponding to the integer part is truncated to keep the 16 most significant bits
M32 : The value corresponding to the integer part is truncated to keep the 32 most significant bits
M64 : The value corresponding to the integer part is truncated to keep the 64 most significant bits
C-2
Type Conversion
MR : Conversion into REAL or VT_R4 with rounding. See [IEC_60559/IEE_754] ; if the value is too large, an error is generated
ML : Conversion into REAL or VT_R8 with rounding. See [IEC_60559/IEE_754] ; if the value is too large, an error is generated
R8 : Conversion into UINT and from UINT into USINT. See [IEC_60559/IEE_754]. If the value is too large or negative, an error is
generated
R16 : Conversion into UINT truncated to the decimal, with rounding. See [IEC_60559/IEE_754]. If the value is too large or
negative, an error is generated
R32 : Conversion into UDINT truncated to the decimal, with rounding. See [IEC_60559/IEE_754]. If the value is too large or
negative, an error is generated
R64 : Conversion into ULINT truncated to the decimal, with rounding. See [IEC_60559/IEE_754]. If the value is too large or
negative, an error is generated
RS8 : Conversion into INT and from INT into SINT. See [IEC_60559/IEE_754] . If the value is too large or negative, an error is
generated
RS16 : Conversion into INT truncated to the decimal, with rounding. See [IEC_60559/IEE_754]. If the value is too large, an error
is generated
RS32 : Conversion into DINT truncated to the decimal, with rounding. See [IEC_60559/IEE_754]. If the value is too large, an
error is generated
RS64 : Conversion into LINT truncated to the decimal, with rounding. See [IEC_60559/IEE_754]. If the value is too large, an
error is generated
SBS : Conversion of a STRING into VT_BSTR; the most significant byte takes value 00
SL : The litteral value contained in the STRING is converted in the desired format. If the value does not correspond to the
desired format or if it is too large, an error is generated
SW : Conversion from STRING into WSTRING; the most significant byte takes value 00
TD8 : Rounded to the closes 8 bit signed integer. If the value is too large or too small, an error is generated
TD16 : Rounded to the closes 16 bit signed integer. If the value is too large or too small, an error is generated
TD32 : Rounded to the closes 32 bit signed integer. If the value is too large or too small, an error is generated
TD64 : Rounded to the closes 64 bit signed integer. If the value is too large or too small, an error is generated
TV : The duration is converted into a value in ms. If the value is too large, an error is generated
VBE8 : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1, extended with zeros on the 8 most
significant bits
VBE16 : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1, extended with zeros on the 16 most
significant bits
VBE32 : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1, extended with zeros on the 32 most
significant bits
VBE64 : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1, extended with zeros on the 64 most
significant bits
VBB : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1
VBEL : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1 as an INT converted to LREAL
VBER : If the value is equal to zero, the boolean takes value 0. If not, it takes the value 1 as an INT converted to REAL
VT : The value is considered in ms and is converted into a duration (days, hours, minutes, seconds and milliseconds). If the
value is too large, an error is generated
WL : The litteral value contained in the WSTRING is converted in the desired format. If the value does not correspond to the
desired format, or if it is too large, an error is generated
X : Conversion of used types. The fields of the structure are converted one by one, as it is not possible to convert a complete
structure (thus, no links to the complete structure, only to the individual fields). If the enumeration does not have the
corresponding constant (value), an error is generated
Conversion Impossible
C-4
Index
D Index
Actions ............................................... 3-14 Boolean Animation ........................... 3-10
Active Component Color ................... 3-10 Boolean Expressions Operators ........ 4-16
D-6
Index