0% found this document useful (0 votes)
126 views

Automation Sequential Function Chart Guide

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views

Automation Sequential Function Chart Guide

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 170

Sequential Function

Chart (SFC)

User’s Guide
Famic Technologies Inc. All rights reserved.©

Automation Studio™ - Sequential Function Chart User’s Guide


Document Reference: DASG7ENFTP62U_020

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.

Windows is a registered trademark of Microsoft Corporation.


Automation Studio™ is a registered trademark of Famic Technologies®
Table of Contents

1 Introduction ................................................................................................................... 1-1


2 SFC Representation....................................................................................................... 2-1
2.1 SFC Graphical Representation ............................................................................... 2-1
2.2 Creation of SFC documents ................................................................................... 2-2
2.3 Description of SFC Components ........................................................................... 2-9
3 Description of the SFC Editor ...................................................................................... 3-1
3.1 “Home” Tab ........................................................................................................... 3-1
3.2 “Edit” Tab .............................................................................................................. 3-4
3.3 “View” Tab ............................................................................................................ 3-5
3.4 “Simulation” Tab ................................................................................................... 3-5
3.5 “Sequential Function Chart” Tab ........................................................................... 3-5
3.6 “Tools” Tab ........................................................................................................... 3-7
3.7 Project Properties ................................................................................................... 3-7
3.7.1 SFC Standards – Management ................................................................. 3-7
3.7.2 SFC Standards – Editing Options ............................................................ 3-8
3.7.3 SFC Standards – “Simulation’’ Tab ...................................................... 3-10
3.8 Document Properties ........................................................................................... 3-10
3.9 Step Properties ..................................................................................................... 3-13
3.9.1 Actions ................................................................................................... 3-15
3.9.2 Step Time Supervision ........................................................................... 3-18
3.10 Transition Properties ............................................................................................ 3-19
3.10.1 Conditions.............................................................................................. 3-21
3.11 Structured Text Properties ................................................................................... 3-24
3.11.1 Structured text – actions/conditions ....................................................... 3-26
3.12 Comment Properties ............................................................................................ 3-29
4 SFC Syntax ..................................................................................................................... 4-1
4.1 Introduction ........................................................................................................... 4-1
4.2 Identifiers Naming ................................................................................................. 4-1
4.2.1 Steps ........................................................................................................ 4-2

© Famic Technologies inc. i


Automation Studio™ – Sequential Function Chart Workshop

4.2.2 Transition .................................................................................................4-3


4.2.3 Structured Text ........................................................................................4-3
4.2.4 Comment ..................................................................................................4-4
4.2.5 Reserved Keywords .................................................................................4-4
4.2.6 Variable Types .........................................................................................4-4
4.2.7 Creating Variables ...................................................................................4-6
4.2.8 Creating External Links on Variables ......................................................4-7
4.3 Constants ................................................................................................................4-7
4.4 Operators ................................................................................................................4-8
4.4.1 Basic Arithmetic Expression Operators ...................................................4-8
4.4.2 Advanced Mathematical Expression Operators .......................................4-9
4.4.3 Boolean Expression Operators ...............................................................4-16
4.4.4 Edge Operators ......................................................................................4-17
4.4.5 Relational Operators ..............................................................................4-18
4.4.6 EXECUTE Operator ..............................................................................4-18
4.5 Operator Priority ..................................................................................................4-21
4.6 Assignment Operators ..........................................................................................4-22
4.6.1 Continuous Boolean Assignment ...........................................................4-22
4.6.2 Numeric Assignment .............................................................................4-23
4.6.3 Conditional Boolean Assignment ..........................................................4-23
4.6.4 Conditional Numerical Assignment .......................................................4-24
4.6.5 Stored Boolean Assignment ...................................................................4-24
4.6.6 Enumeration Assignment .......................................................................4-25
4.6.7 Structure Assignment .............................................................................4-26
4.6.8 Array Assignment ..................................................................................4-27
4.7 Syntax Analysis ...................................................................................................4-29
4.8 Timing ..................................................................................................................4-29
4.9 Managing SFC States and SFC Faults .................................................................4-32
4.10 Macro Steps .........................................................................................................4-34
4.11 Enclosures ............................................................................................................4-36
4.11.1 Enclosure’s Elements .............................................................................4-36
4.11.2 Enclosure’s Rules...................................................................................4-37
4.11.3 Use in Automation StudioTM ..................................................................4-39
4.12 Hierarchical Forcing ............................................................................................4-41
4.12.1 Rules on Hierarchical Forcing ...............................................................4-42
4.13 Type Conversion ..................................................................................................4-43
4.13.1 Implicit Conversion ...............................................................................4-43
4.13.2 Explicit Conversion ...............................................................................4-44

ii
Table of Contents

5 Predefined SFC Variables ............................................................................................ 5-1


6 Creation of a First SFC ................................................................................................. 6-1
6.1 Operative Part ........................................................................................................ 6-1
6.2 Creating a new SFC ............................................................................................... 6-2
6.3 Editing the SFC ..................................................................................................... 6-4
6.3.1 Initial Step ............................................................................................... 6-6
6.3.2 First Transition ........................................................................................ 6-6
6.3.3 First Action Setup .................................................................................... 6-8
6.3.4 Inserting Other Steps and Transitions .................................................... 6-10
6.3.5 Inserting Links ....................................................................................... 6-12
6.3.6 Inserting Branches ................................................................................. 6-14
6.3.7 Inserting Structured Texts...................................................................... 6-17
6.3.8 Inserting Free Comments ....................................................................... 6-19
6.3.9 Components links .................................................................................. 6-20
6.4 Check for Errors .................................................................................................. 6-22
7 Simulation ...................................................................................................................... 7-1
7.1 State of an SFC During Simulation ....................................................................... 7-1
7.2 Step and Transition States During Simulation ....................................................... 7-1
7.3 Fault Management During Simulation................................................................... 7-3
7.3.1 Sequence Duration Monitoring ................................................................ 7-3
7.3.2 Step Duration Monitoring ........................................................................ 7-6
7.3.3 General Fault ........................................................................................... 7-9
7.4 Windows Layout .................................................................................................... 7-9
7.5 Project Simulation ............................................................................................... 7-10
7.6 Possible Problem Causes ..................................................................................... 7-11
7.6.1 Structure Errors...................................................................................... 7-11
7.6.2 Syntax Errors ......................................................................................... 7-11
8 Export ............................................................................................................................. 8-1
8.1 Export GIE ............................................................................................................. 8-2
8.2 Export Siemens STEP 7 (3xx and 4xx) ................................................................. 8-3
8.2.1 Conditions................................................................................................ 8-4
8.2.2 Export Process ......................................................................................... 8-4
8.3 Export Ladder (Allen-Bradley) .............................................................................. 8-8
A Glossary ............................................................................................................................. 1

© Famic Technologies inc. iii


Automation Studio™ – Sequential Function Chart Workshop

B Variable Operators ........................................................................................................... 1


C Type Conversion ............................................................................................................... 1
D Index .................................................................................................................................. 5

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.

This guide is divided into the following sections:

Chapter 2 SFC Representation: This chapter describes the representation of elements


constituting a typical SFC and its illustration in Automation Studio ™.

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 6 Creation of a First SFC: In this chapter an example of an application is presented


as a small project, in order to assimilate all the functionalities of this workshop.

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

© Famic Technologies inc. 1-1


Automation Studio™ – Sequential Function Chart Workshop

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.

The basic elements are:


• Steps, with which actions are associated;
• Transitions, with which conditions are associated;
• Structured texts, or actions that are not linked to a step;
• Links to connect steps and transitions.

2.1 SFC Graphical Representation


The following figure represents a typical SFC using various basic SFC components.

© Famic Technologies inc. 2-1


Automation Studio™ – Sequential Function Chart Workshop

Figure 2-1: SFC Example

2.2 Creation of SFC documents


SFC graphs have to be created in document(s) of “Sequential Function chart” type. This
type of documents is created the same way as any other type of documents using the
“Document” command of the “New” group located in the “Home” tab.

2-2
SFC Representation

Figure 2-2: Creating a new Sequential Function Chart Diagram

The templates window is then displayed allowing to select the template to be used for
the Sequential Function Chart document under creation.

Figure 2-3: Sequential Function Chart Templates Window

© Famic Technologies inc. 2-3


Automation Studio™ – Sequential Function Chart Workshop

 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.

Figure 2-4: “Export Warning” Window

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:

Export Limitations Warning Text


Type

2-4
SFC Representation

Export Limitations Warning Text


Type

If you create this SFC with the aim of exporting it to


the “Allen-Bradley” Ladder format or the “Siemens”
STEP 7 SFC format, please follow the
recommendations and the limitations enumerated
below.

If you do not follow these recommendations, during


the export, the process will be interrupted during the
stage of validation, and an error message will indicate
the reason of the interruption. You can then make the
required modifications in the concerned graph and
relaunch the export.

Exporting Supported PLC Only the models of SLC 500 and MicroLogix series are
graphs to models supported.
Allen-
Bradley
Ladder
format

Usable variable The use of variables in the graphs has to be limited to


types the following types:

• 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.

Limitations on Timers are subject to the following limitations:

© Famic Technologies inc. 2-5


Automation Studio™ – Sequential Function Chart Workshop

Export Limitations Warning Text


Type
timers
• Timer’s value cannot exceed 32767 seconds;

• The minimal resolution of a timer is 0.01 second.

Limitations on the • The naming is subject to the following limitations:


naming
• The name of a graph has to contain no more than
10 characters;

• The full name of a variable (including its location)


must not exceed 20 characters;

• The names of variables and graphs have to


contain only letters A-Z, numbers 0-9 or
underscore (_);

• A variable’s name cannot be composed only of a


number followed by a unique letter from the
following list: “D, O, H, E, or B”;

• A variable’s name cannot be composed only of a


unique letter I, O or S followed by a number.

Other limitations Other limitations to consider:

• Implicit conversions of Boolean into numerical


format are not supported;

• The same Boolean variable can be affected either


in a monostable way, or in a bistable way, but not
both.

Exporting Supported PLC Only the 3xx and 4xx models are supported.
graphs to models
Siemens

2-6
SFC Representation

Export Limitations Warning Text


Type
STEP 7
SFC
format

Usable variable All variable types are supported with the following
types limitations:

• USINT, UINT, UDINT, ULINT, LINT, LWORD, WSTRING


and LREAL types are transformed into the closest
compatible type. Overflow/Underflow may arise;

• User-defined types (Enumerations, Structures and


arrays) are not supported;

• STRING type is partially supported. Its use is


limited to the assignment, the comparison and
the forcing towards INT, DINT and REAL.

Other limitations Other limitations to consider:

• Activation time of a step is differently managed in


Automation Studio™ and in Siemens. Automation
Studio™ resets to zero the activation time of a
step during its deactivation. Siemens resets to
zero the activation time of a step during its
reactivation. This can cause differences between
the behavior of a graph in Automation Studio ™
and in Siemens;

• The MODULO function does not accept the REAL


type. Expressions (actions and receptivities) using
this function will not be exported;

• External variables (variables defined in a


document that is not of a SFC document) are not
supported. Expressions (actions and receptivities)

© Famic Technologies inc. 2-7


Automation Studio™ – Sequential Function Chart Workshop

Export Limitations Warning Text


Type
using such variables will not be exported;

• Internal variables of a graph are not supported


(INIT, RUN, ESC, RUNNING, FORCED, GEN_FAULT,
STEP_MAX_ACK, STEP_MIN_ACK, SEQ_MAX_ACK,
SEQ_MIN_ACK, STEP_MAX_FAULT,
STEP_MIN_FAULT, SEQ_MAX_FAULT and
SEQ_MIN_FAULT). Expressions (actions and
receptivities) using such variables will not be
exported;

• Step and transition variables (X1.X, X1.T and Y1.Y)


are “READ ONLY” in Siemens STEP 7. Expressions
(actions and receptivities) that modify such
variables will not be exported;

• Contrary to Automation Studio™, STEP 7 does not


activate simultaneously two alternative branches
even if the receptivities of these transitions are
simultaneously performed. STEP 7 prioritizes the
transitions most to the left when more than a
receptivity is active;

• STEP 7 cannot activate simultaneously two steps


on the same path. During forcing or enclosing a
graph, if several steps on the same path are
activated, only the first forced/enclosed step will
be activated. This is also valid for the enclosed
graphs having an initial step different from the
activation link step;

Timer’s values exceeding the maximum accepted by


STEP 7 are automatically adjusted during the export.

 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.3 Description of SFC Components


The elements that can be found in a SFC are listed in the following table:

Name Symbol Description

Inactive Initial An initial step is represented by a double


Step box identified by a number.

Standard Step A standard step is represented by a


and Action square box identified by a number.

The step input is always on top.

The step output is always on the bottom.

Actions are connected to their


corresponding step with a link.

A step doesn’t necessary lead to an


action.

Macro Step A macro step is represented by a box with


rectangles at the top and bottom and
identified by a number.

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 An IN step is represented by a box with a


rectangle on top and identified by a
number.

© Famic Technologies inc. 2-9


Automation Studio™ – Sequential Function Chart Workshop

Name Symbol Description

Out Step An OUT step is represented by a box with


a rectangle on the bottom and identified
by a number.

Standard A standard enclosing step is represented


Enclosing Step by a square box with an octagon
identified by a number.

Initial Enclosing An initial enclosing step is represented by


Step a double square box with an octagon
identified by a number.

Standard A standard enclosed step with activation


Activation Link link is represented by a square box
Step identified by a number and an * at the left
of the square box.

Initial An initial enclosed step with activation


Activation Link link is represented by a double square box
Step identified by a number and an * at the left
of the square box.

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.

2-10
SFC Representation

Name Symbol Description

Link A link connects the output of a transition


to the input of a step or the opposite.

OR Divergence When a connection exists between one


step and more than one transition, an OR
divergence is drawn instead of the link.

OR When a connection exists between


Convergence multiple source transitions and one step,
an OR convergence is drawn instead of
the link.

AND When a connection exists between a


Divergence single source transition and multiple
steps, an AND divergence is drawn
instead of the link.

AND When a connection exists between


Convergence 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 a SFC.

© Famic Technologies inc. 2-11


Automation Studio™ – Sequential Function Chart Workshop

Name Symbol Description

Comment Comments can be positioned anywhere in


the diagram, they are bound to the SFC.

Jumps Jumps simplify SFC diagrams. Jumps


replace links between two components
that are not close to each other.

Indicates that the link goes to step


(X) 1.

Indicates that the link comes from


transition (Y) 9.

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.

3.1 “Home” Tab


The “Home” tab contains the main functions of the SFC standard editor.

Figure 3-1: “Home” Tab

The SFC diagram’s “Home” tab options are as follows:

“Links” Group

This provides access to actions on links and branches. (AND or OR


convergence/divergence).

Figure 3-2: “Home” Tab, “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.

Figure 3-3: Contextual Menu for a Branch

© Famic Technologies inc. 3-1


Automation Studio™ – Sequential Function Chart Workshop

Figure 3-4: Contextual Menus for a Link and a 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

The SFC commands of the “Home” tab are as follows:

Option Description

Alternate Step/Transition Alternate the insertion of normal steps and transitions.


Start with a step.

Step Drop-down list allowing to Insert all types of steps.

3-2
Description of the SFC Editor

Option Description

This drop-down list contains the following types:


• Standard Step: Allows inserting a standard step.
• Initial Step: Allows inserting an initial step.
• Macro Step: Allows inserting a macro step.
• In Step: Allows inserting an input step on a SFC
defined as a macro.
• Out Step: Allows inserting an output step on a SFC
defined as a macro.
• Initial Enclosing Step: Allows inserting an initial
enclosing step. See 4.11.1 Enclosure’s Elements.
• Standard Enclosing Step: Allows inserting a standard
enclosing step. See 4.11.1 Enclosure’s Elements.
• Initial Activation Link Step: Allows inserting an initial
enclosed step with activation link. See 4.11.1
Enclosure’s Elements.
• Standard Activation Link Step: Allows inserting a
standard enclosed step with activation link. See
4.11.1 Enclosure’s Elements.

Transition Allows inserting a transition.

Alternate Transition/Step Alternate the insertion of transitions and standard steps.


It starts with a transition.

Structured Text Allows inserting a structured text.

Comment Allows inserting a free comment.

Convert Step This converts a standard step into an initial step and vice
versa.

© Famic Technologies inc. 3-3


Automation Studio™ – Sequential Function Chart Workshop

3.2 “Edit” Tab


The “Edit” tab contains the tools for clipboard, formatting and appearance of texts and
components on the diagram.

Figure 3-6: “Edit” Tab

The “Edit” tab options can be found in the Automation Studio™ User’s Guide. In this
workshop, only the “Select” option will be explained.:

“Edit” Tab  “Select”

“Select” dropdown menu: Allows multiple selection of identical SFC components.

Figure 3-7: Options from the “Select” Command of the “Edit” Tab

Option Description

All Selects all components in the SFC.

Steps Selects all steps.

Transitions Selects all transitions.

Structured Texts Selects all structured texts.

Comments Selects all comments.

3-4
Description of the SFC Editor

Option Description

Links Selects all links.

Follow Selects everything that follows the currently selected step


or transition (including itself).

3.3 “View” Tab


The “View” Tab contains the shortcuts to access the properties, to display some
information or to navigate into the different diagrams.

Figure 3-8: “View” Tab

The “View” Tab options can be found in the Automation Studio™ User’s Guide.

3.4 “Simulation” Tab


The “Simulation” Tab contains the specific functions for the simulation of a SFC document
or project.

Figure 3-9: “Simulation” Tab

The “Simulation” Tab options can be found in the Automation Studio™ User’s Guide.

3.5 “Sequential Function Chart” Tab


The “Sequential Function Chart” tab contains the specific functions of the SFC workshop.

© Famic Technologies inc. 3-5


Automation Studio™ – Sequential Function Chart Workshop

Figure 3-10: “Sequential Function Chart” tab

“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.

Figure 3-11: Right click menu of a SFC component

Option Description

Renumber This renumbers all selected unlocked items.

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

Unlock Number This opens the selected item number to be renumbered.

3.6 “Tools” Tab


The ‘’Tools’’ Tab offers all the management tools.

Figure 3-12: “Tools” Tab

These command buttons and their behaviour information can be found in the Automation
Studio™ User’s Guide.

3.7 Project Properties


The Project Properties window has the branch “Automation” → “SFC Standards” that
allows you to manage SFC standards. The first tab concerns the behaviour while in the
edition mode; the second tab concerns the behavior while in the simulation mode.

3.7.1 SFC Standards – Management

Figure 3-13: “Automation” → “SFC Standards” Branch of the Project Properties Window,
SFC Standards Management Section

© Famic Technologies inc. 3-7


Automation Studio™ – Sequential Function Chart Workshop

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.

For more information, go to the Automation Studio™ User’s Guide.

3.7.2 SFC Standards – Editing Options

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 Fit Branches Specifies whether branches are automatically adjusted or


not.

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.

Display Statements Specifies whether the action or transition statements are


(action, transition), displayed or not for each SFC component.
Level 2

Display Comments, Specifies whether the comments Level 1 are displayed or


Level 1 not for each SFC component.

Display Comment Specifies whether the Comment Component Number is


Component Number displayed or not for each SFC component.

Display ‘’Structured Specifies whether the ‘’Structured Text’’ is displayed or not


Text’’ Component for each SFC component.
Number

Apply Colors to Syntax Specifies whether or not to apply colors to syntax elements.
Elements

Operators Color Specifies the color associated with operators.

Number Color Specifies the colors associated with numbers.

Defined Variable Color Specifies the colors associated with defined variables.

Undefined Variable Specifies the colors associated with undefined variables.


Color

 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.

© Famic Technologies inc. 3-9


Automation Studio™ – Sequential Function Chart Workshop

3.7.3 SFC Standards – “Simulation’’ Tab

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

Boolean Animation Specifies whether a Boolean animation is required.

Numerical Animation Specifies whether a numerical animation is required.

Active Step Scrolling Specifies if the active step scrolling is desired.

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.8 Document Properties


An SFC’s “Document Properties” dialogue box is similar to the one of other document

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:

Figure 3-16: “Document Properties” Dialogue Box;

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.

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 to 999
range.

Unconditional This checkbox, checked by default, allows an

© Famic Technologies inc. 3-11


Automation Studio™ – Sequential Function Chart Workshop

Section Description
SFC Run 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

Class This allows you to specify whether the SFC is an


explosion of a macro step or a standard SFC by using
the drop-down list. The SFC is defined as being
STANDARD by default.

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.

If the sequence is active for a shorter period, the


minimum sequence time defaults to TRUE (eg.:
SEQ_MIN_FAULT).

Max Sequence This option allows you to set a maximum time for
Time the SFC’s sequence.

If the sequence is active for a longer period, the


maximum sequence time defaults to TRUE (eg. :
SEQ_MAX_FAULT).

SFC Simulation Simulated: When this option is selected, the


Mode simulator executes the actions and evaluates their
links. In other words, it updates the variables and it
simulates the flow chart.

Animated: When this option is selected, the


simulator simply reads and describes the state of
each internal and external variable (OPC). In other

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.

3.9 Step Properties


In this dialogue the user can specify the equations that will determine the actions that
are associated with a step.

Figure 3-17: “Step Properties” Dialogue Box

© Famic Technologies inc. 3-13


Automation Studio™ – Sequential Function Chart Workshop

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 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. Two steps in the same SFC cannot have the same
number.

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.

Type Type of step.

The user can choose between standard, initial, macro, in or out


type from a drop-down list.

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.

Figure 3-18: “Actions” Dialogue Zone

Zone Description

Statement This zone is used to edit the different actions associated with the

© Famic Technologies inc. 3-15


Automation Studio™ – Sequential Function Chart Workshop

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:

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.

Below is an example of a typical action:

Unconditional This checkbox determines whether the running of the actions of the
Actions step is conditional to the running state of the SFC.

Syntax This checkbox will activate syntax analysis during edition by


(checkbox) displaying different colors if any mistakes are made during the
actions statement.

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

Figure 3-19: “Variables” Dialogue Zone

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

 It is the selection done during the insertion of each variable


that will be applied on the display of this variable.

 It is possible to use the alias for certain variables, and the


name for other variables in the same step. To do this, you
have to select the desired display mode (Name or Alias) for
each variable at its insertion.

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

© Famic Technologies inc. 3-17


Automation Studio™ – Sequential Function Chart Workshop

Zone Description
sorted by clicking on a column.

3.9.1.3 Syntax and Operators

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.

Figure 3-20: “Syntax and Operators” Dialogue Zone

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.9.2 Step Time Supervision

This dialogue allows the user to specify the minimum and maximum activation times for
the step.

3-18
Description of the SFC Editor

Figure 3-21: “Step Time Supervision” Dialogue Zone

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)

If the entered value is greater than zero, it must be smaller


than the maximum activation time.

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).

If the entered value is greater than zero, it must be greater


than the minimum activation time.

3.10 Transition Properties


The user can specify the conditions associated with a transition in this dialogue box.

© Famic Technologies inc. 3-19


Automation Studio™ – Sequential Function Chart Workshop

Figure 3-22: “Transition Properties” Dialogue Box

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 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.

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.

Conditions This zone is used to edit the transition condition.

Comment Comments may be added in reference to the transition.

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.

© Famic Technologies inc. 3-21


Automation Studio™ – Sequential Function Chart Workshop

Figure 3-23: “Conditions” Dialogue Zone

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:

Write the conditions to be followed by using the variables and


operators can be found in the Syntax and Operators zone.

Below is an example of a typical condition.

Basic equation:

Edited equation:

Syntax This checkbox will activate syntax analysis during edition by


(checkbox) displaying different colors if any mistakes are made during the
actions statement.

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

Figure 3-24: “Variables” Dialogue Zone

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

 It is the selection done during the insertion of each variable


that will be applied on the display of this variable.

 It is possible to use the alias for certain variables, and the


name for other variables in the same transition. To do this,
you have to select the desired display mode (Name or Alias)
for each variable at its insertion.

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.

© Famic Technologies inc. 3-23


Automation Studio™ – Sequential Function Chart Workshop

3.10.1.3 Syntax and Operators

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.

Figure 3-25: “Syntax and Operators” Dialogue Zone

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.11 Structured Text Properties


In this dialogue box, the user can specify the formulas that determine the actions
associated with a structured text.

3-24
Description of the SFC Editor

Figure 3-26: “Structured Text Properties” Dialogue Box

The zones and buttons of this dialogue box are:

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.

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.

© Famic Technologies inc. 3-25


Automation Studio™ – Sequential Function Chart Workshop

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.

Comment Add comments in reference to the structured text.

3.11.1 Structured text – actions/conditions

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.

Figure 3-27: “Structured Text” Dialogue Zone

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.

Below is an example of a typical structured text:

Syntax This checkbox will activate syntax analysis during edition by


(checkbox) displaying different colors if any mistakes are made in the
statement.

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.

© Famic Technologies inc. 3-27


Automation Studio™ – Sequential Function Chart Workshop

Figure 3-28: “Variables” Dialogue Zone

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

 It is the selection done during the insertion of each variable


that will be applied on the display of this variable.

 It is possible to use the alias for certain variables, and the


name for other variables in the same structured text. To do
this, you have to select the desired display mode (Name or
Alias) for each variable at its insertion.

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.

3.11.1.3 Syntax and Operators

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.

Figure 3-29: “Syntax and Operators” Dialogue Zone

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.12 Comment Properties


In this dialogue box the user can edit the text of a comment.

© Famic Technologies inc. 3-29


Automation Studio™ – Sequential Function Chart Workshop

Figure 3-30: “Comment Properties” Dialogue Box

The zones and buttons in this dialogue box are:

Zones Description

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.

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.

Comment Add comments.

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.

4.2 Identifiers Naming


The identifiers naming allows a physical interpretation to be associated with every SFC
symbol, be it a step, a transition or a variable. When one of these symbols is created,
Automation Studio™ automatically generates a new name (except for variables), and
assigns a unique number between 1 and 999.

Names are identifiers and must respect these basic rules:


• They are composed of standard alphanumeric characters: “a-z, A-Z, 0-9, _, +, -”;
• They do not begin with a number;
• They can be composed of multiple elements, each of these separated by a
period (.).

Variable Type

© Famic Technologies inc. 4-1


Automation Studio™ – Sequential Function Chart Workshop

Variable Type

.variable A variable associated with a project.

variable A variable associated with the current SFC.

.SFC1.variable A variable associated with a SFC other than the


current one, when both are in the same project.

• They are composed of 1 to 32 characters;


• They do not contain any empty characters (spaces);
• They do not contain any accented characters;
• The names are not case-sensitive. The names are converted to all-uppercase
once Automation Studio™ recognizes them.
• If the SFC is used to control electro-pneumatic, ladder, electric or digital circuits
make sure that the naming of the components from those circuits follow these
same rules.

 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.

Figure 4-1: Inserting a Step

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

When a new transition is inserted, it is assigned a unique number by Automation Studio ™


within the range (1 to 999) . The number is used to refer to this transition in a given SFC.

Figure 4-2: Inserting a Transition

4.2.3 Structured Text

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.

Figure 4-3: 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.

© Famic Technologies inc. 4-3


Automation Studio™ – Sequential Function Chart Workshop

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.

Figure 4-4: 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;
• 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.

4.2.6 Variable Types

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:

- Name that begins with “ANY_”;

- Are used to group basic types;

- Cannot be used to define a variable type;

- Are used to define the input/output variable types supported by the


operators (see section 4.4 Operators).

The figure below shows the variables supported by AS6.0, sorted hierarchically.

© Famic Technologies inc. 4-5


Automation Studio™ – Sequential Function Chart Workshop

Figure 4-5: Hierarchy of variable types

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.

4.2.7 Creating Variables

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

4.2.8 Creating External Links on Variables

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.

For type ANY_STRING, it is enough to use quotation marks.

Example:
• “ERROR”

In order to get a constant of type ANY_SYSTEM, an explicit conversion operator must be

© Famic Technologies inc. 4-7


Automation Studio™ – Sequential Function Chart Workshop

used (see section 4.13.2 Explicit Conversion).

Examples:
• TO_CURRENCY(89.99);
• TO_DECIMAL(0.25).

It is not possible to get a constant of type ANY_DERIVED.

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).

4.4.1 Basic Arithmetic Expression Operators

Arithmetic operators are used to construct simple mathematical expressions involving


numerical or decimal variables.

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

4-8
SFC Syntax

Operator Description and example

+ 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.4.2 Advanced Mathematical Expression Operators

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.

Operator Description and example

ABS Absolute value, real or integer: ABS(.Ls1).

© Famic Technologies inc. 4-9


Automation Studio™ – Sequential Function Chart Workshop

Operator Description and example

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.

SHL Shift left, words 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

4-10
SFC Syntax

Operator Description and example

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.

Example :

Enter the following integer: .A = [1 0 1 1 0 1 0 0], as shown.

Shifting 3 bits to the left gives:

.B := SHL(.A, 3) = [1 0 1 0 0 0 0 0].

SHR Shift right, words 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.

© Famic Technologies inc. 4-11


Automation Studio™ – Sequential Function Chart Workshop

Operator Description and example

.Ls2 := SHR(.Ls2,.Ls3)

Right shift of .Ls2 by .Ls3 positions

The result is affected to .Ls2, .Ls2 takes on the final value.

Example :

Enter the following integer: .A = [1 0 1 1 0 1 0 0], as shown.

Shifting 3 bits to the right gives:

.B := SHR(.A, 3) = [0 0 0 1 0 1 1 0].

ROL Rotational left shift, words 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.

Example :

Enter the following integer: .A = [1 0 1 1 0 1 0 0], as shown.

4-12
SFC Syntax

Operator Description and example

A 3 bit rotational left shift gives:

.B := ROL(.A, 3) = [1 0 1 0 0 1 0 1].

ROR Rotational right shift, words 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.

Example :

Enter the following integer: .A = [1 0 1 1 0 1 0 0], as shown.

A 3 bit rotational left shift gives:,

© Famic Technologies inc. 4-13


Automation Studio™ – Sequential Function Chart Workshop

Operator Description and example

.B := SHR(.A, 3) = [1 0 0 1 0 1 1 0].

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.

4-14
SFC Syntax

Operator Description and example

MAX Maximum of multiple values, real or integer.

.Ls1:= MAX(In1, In2, …, In16)

Maximum value of a maximum 16 variables.

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.

© Famic Technologies inc. 4-15


Automation Studio™ – Sequential Function Chart Workshop

Operator Description and example

.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.4.3 Boolean Expression Operators

These operators are used to evaluate logical expressions involving variables. The
returned value is a Boolean.

The following table describes these operators.

Operator Description

OR Logical OR between Boolean values.

E.g.: .Ls1 OR .Ls2

XOR Exclusive logical OR between Boolean values.

E.g.: .Ls1 XOR .Ls2

AND Logical AND between Boolean values.

E.g.: .Ls1 AND .Ls2

4-16
SFC Syntax

Operator Description

NOT Negation of a Boolean value or a word.

E.g.: NOT .Ls1

4.4.4 Edge Operators

An expression involving an edge operator is a Boolean expression. It is triggered by a


change in state.

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.

© Famic Technologies inc. 4-17


Automation Studio™ – Sequential Function Chart Workshop

Figure 4-6: Timing Diagram of an Action using a Rising Edge Operator

4.4.5 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 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.

4.4.6 EXECUTE Operator

The operator EXECUTE is used to launch a command.

Syntax :

4-18
SFC Syntax

B1 := EXECUTE(H1,S1,…Sn)

Syntax Description
Element

B1 Variable receiving the value returned by the EXECUTE Operator. It


indicates if the script was run without error.

:= Assignment Operator. See Section 4.6 Assignment Operators

EXECUTE Operator that launches H1.

H1 H1 (Variable or Constant of type HYPERLINK or ANY_STRING) always


include a Protocol followed by a Colon “:” and then by a Command.

The following Protocols may be used:

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)

HTTP (URL ex.: http://www.automationstudio.com)

FILE (URL ex.: file://C:\Projet1.pr5)

FTP (URL ex. ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt)

ASREFISO (This protocol is used to target a component, a subcomponent


or a variable using its internal identifier or ISO code in standard and
electrical diagrams, or using a derivative. The advantage is its simplicity,
because the ISO code is unique and therefore it implicitly defines in

© Famic Technologies inc. 4-19


Automation Studio™ – Sequential Function Chart Workshop

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.)

NOTE: For more information on the ASREFISO or ASREF Syntax, go to the


Ribbon > Home Tab > “Drawing” Group > Open a “Line” or other drawing
component > Open Component Properties > “Hyperlink” Branch > Press
on F1 or ?

S1 First Script Argument (requires a character string: it is possible to use the


conversion operator TO_STRING)

Sn Any number of other Script Arguments (requires a character string: it is


possible to use the conversion operator TO_STRING)

Example of an EXECUTE command with a script:

Figure 4-7: Example with a script

1. EXECUTE command;

2. Protocol Name: SCRIPT;

3. Script Name: helloworldargs.rb;

4. First Script Argument: the variable “VarINT” will be converted into a “String”.

SFC example with many EXECUTE commands:

In the following SFC:

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.

Figure 4-8: Example of a SFC with a Script

4.5 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

() Parenthesis

+, -, NOT, ^, ! Unitarian Operators

© Famic Technologies inc. 4-21


Automation Studio™ – Sequential Function Chart Workshop

Operator Priority

*, / Multiplication Operators

+, - Additive Operators

<, <=, >, >= Relative Operators

=? <> Relative Operators

XOR Additive Operators

AND 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.

4.6 Assignment Operators


Assignment operators define the types of action and their effects. They can be applied to
any variable type except for those in category ANY_CUSTOM. They are used in actions and
structured texts. The following sections describe 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.6.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.

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.

Figure 4-9: Continuous Boolean Assignment in an Action

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.

4.6.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 4-10: 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.6.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,

© Famic Technologies inc. 4-23


Automation Studio™ – Sequential Function Chart Workshop

FALSE is assigned to the Boolean variable. The conditional assignment operator's sign is:
“IF”.

Figure 4-11: Conditional Boolean assignment

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.

4.6.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 4-12: Conditional numerical assignment

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.

4.6.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 4-13: Stored assignment

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.

4.6.6 Enumeration Assignment

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.

In the following figure, a user-defined Enumeration type called « Line_Function » was


created. This type can take one of the following five values: “Pressure”, “Pilot”,
“Load_Sense”, “Drain” and “Return”.

Figure 4-14: Example of a user-defined Enumeration

The assignment of “Var1” of “Line_Function” type is done as shown in the figure below.

Figure 4-15: Example of an Enumeration Assignment

In this example, the variable “Var1” takes the value “Drain” at the activation of step 2.

© Famic Technologies inc. 4-25


Automation Studio™ – Sequential Function Chart Workshop

This value remains active until the next assignment of the same variable by SFC or
manually.

4.6.7 Structure Assignment

The Structure Assignment allows assigning values to the components of a variable of


Structure type. The components’ assignment is done according to each component type
(Boolean, numerical, …). To assign a component of a Structure type variable, the syntax
to use is the following:

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”.

Figure 4-16: Example of user-defined Structure Type

The assignment of “Var2” components, which is a variable of “SumOfTwoINT” type, is


done as shown in the following figure:

4-26
SFC Syntax

Figure 4-17: Example of a Structure Assignment

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.

4.6.8 Array Assignment

There is two Array assignment types : static or dynamic.

4.6.8.1 Static Assignment

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.

© Famic Technologies inc. 4-27


Automation Studio™ – Sequential Function Chart Workshop

Figure 4-18: Example of a user-defined Array

The assignment of the variable “Var3” of “Table_10_par_4” type is done as shown in the
following figure:

Figure 4-19: Example of Array Static Assignment

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.

4.6.8.2 Dynamic Assignment

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:

Figure 4-20: Example of Array Dynamic Assignment

4.7 Syntax Analysis


The SFC Editor uses syntax highlighting. This makes it easy for the user to identify syntax
errors while typing actions, transitions or structured texts.

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

© Famic Technologies inc. 4-29


Automation Studio™ – Sequential Function Chart Workshop

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..

There are four (4) types of timers:

Type Description

(T/, TON/); Timer On-delay.

(TOF/); Timer Off-delay.

(TP/); Pulse delay timer

(Xn.T). Cumulative time since last timer activation.

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

T/, TON/, TOF/, TP/ Timing operator.

Xn.X Identifies the input variable, the step or the variable that will
trigger the timer.

T#a Length of duration time variable.

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

Figure 4-21: Timer On-delay

Timer Off-Delay

The timing operation TOF/Xn.X/T#a/ evaluates to the Boolean value "1" only when either

© Famic Technologies inc. 4-31


Automation Studio™ – Sequential Function Chart Workshop

of the following is true:


• The variable Xn.X is activated.
• The duration defined by T#a is not over;

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

Figure 4-22: Timer Off-delay

Pulse Delay Timer

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

Figure 4-23: Pulse delay timer

4.9 Managing SFC States and SFC Faults


A SFC can be interpreted as a black box that receives an input and generates an output.

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.

Commands and states are internal variables of the SFC.

The state variables that can be modified are :

Internal SFC Variable Description

INIT SFC initialisation.

RUN Authorization to run the SFC and execute the actions


associated with the steps.

ESC External condition that cancels the SFC’s run.

RUNNING State of the SFC being executed.

FORCED Forced state of the SFC.

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:

Internal SFC Variable Description

STEP_MAX_ACK Acknowledgement command for the maximum step duration


fault.

STEP_MIN_ACK Acknowledgement command for the minimum step duration


fault.

© Famic Technologies inc. 4-33


Automation Studio™ – Sequential Function Chart Workshop

Internal SFC Variable Description

SEQ_MAX_ACK Acknowledgement command for the maximum sequence


duration fault.

SEQ_MIN_ACK Acknowledgement command for the minimum sequence


duration fault.

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).

SEQ_MAX_FAULT Maximum sequence duration fault.

SEQ_MIN_FAULT Minimum sequence duration fault.

4.10 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.

Figure 4-24: Defining an SFC as a macro

4-34
SFC Syntax

The name of the SFC is written in the drop-down menu on the right side of the macro
step.

Figure 4-25: Defining a 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.

© Famic Technologies inc. 4-35


Automation Studio™ – Sequential Function Chart Workshop

Figure 4-26: Using Macro Steps

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.

4.11.1 Enclosure’s Elements

The following elements are the main components that can be used in an enclosure:
Symbol Name Description

4-36
SFC Syntax

Standard Enclosing This step contains other enclosed steps


Step in one or several enclosures of the
same enclosing step.

 The enclosing step has all the


properties of the step.

 The enclosing step may lead to


one or several enclosures
having at least one step with
activation link (see below).
Initial Enclosing Enclosing step that participates in the
Step initial situation. In that case, each of
its enclosures shall possess at least
one initial enclosed step.

Standard Activation Enclosed step that is activated when


Link Step the enclosing step is activated.

Initial Activation Enclosed step that is activated at the


Link Step initial situation and when the
enclosing step is activated.

4.11.2 Enclosure’s Rules

The enclosure behave according to the following rules:


• Every enclosure of an enclosing step must contain at least an enclosed step with an
activation link.
• At every activation of the enclosing step, the enclosed step with activation link is
activated, and then the enclosure evolves normally.

© Famic Technologies inc. 4-37


Automation Studio™ – Sequential Function Chart Workshop

• 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:

Figure 4-27: Example – Initial Enclosing Step with Two Enclosures

4-38
SFC Syntax

Step 10 is an initial enclosing step.

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.

4.11.3 Use in Automation StudioTM

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.

Figure 4-28: “Home” Ribbon → “SFC” Group → “Step” Command


• You can modify the type of a step after its insertion on a SFC document. This could be
done by the “Type” drop-down list in the step’s properties dialogue.

© Famic Technologies inc. 4-39


Automation Studio™ – Sequential Function Chart Workshop

Figure 4-29: “Type” Drop-Down List in a Step’s Properties Dialogue


The types related to the enclosure are: “Standard Enclosing”, “Initial Enclosing”,
“Standard Activation Link” and “Initial Activation Link” (see the table above).
An enclosure of an enclosing step must be created on a dedicated SFC document of
“Enclosed” class. To do so, you have to draw the enclosure’s graph on a separate SFC
document, well define the type of the enclosed steps, and then open the document’s
properties dialogue to select the “enclosed” class and determine the enclosing step.

Figure 4-30: Class and Enclosing Step of a 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.

 The SFC document’s title indicates, in simulation, whether it is an enclosure or not.


In the case of an enclosure, the title indicates, besides the standard information,
the corresponding enclosing step’s document and number. The title has the
following format: “Project Name” : ”Document Name” (“Name of the document
containing the enclosing step” * “Enclosing step number”).

Figure 4-31: Class and Enclosing Step of a SFC Document

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.

4.12 Hierarchical Forcing


Forcing statements permit the modification of the SFC state. They are used to impose a
certain situation on a 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.

The general form for forcing is:

F/ SFCn.FORCED:(.SFCn.Xn.FORCED…),

© Famic Technologies inc. 4-41


Automation Studio™ – Sequential Function Chart Workshop

where,

F/ Forcing Operator

.SFCn.FORCED Name of the SFC that will be forced.

:(SFCn.Xm.FORCED,…) 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.

4.12.1 Rules on Hierarchical Forcing


• A SFC cannot force itself;
• A SFC cannot force another SFC on the same hierarchical level;
• A SFC cannot force another SFC on a higher hierarchical level;
• Two SFCs on the same hierarchical level cannot force the same SFC;
• If a 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;
• A SFC can be forced even if it isn’t running. (see 4.9 Managing SFC States and SFC
Faults);

The following figures depict legal and illegal forcing actions:

4-42
SFC Syntax

Figure 4-32: Hierarchical Allowed Forcing

4.13 Type Conversion


There are two types of conversion: implicit and explicit conversions. Implicit conversions
are done automatically, whereas explicit conversions require the use of an operator.
Annex C presents all the possibilities for the type conversion of variables and indicates
whether they are implicit or explicit and what the rules are.

4.13.1 Implicit Conversion

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

© Famic Technologies inc. 4-43


Automation Studio™ – Sequential Function Chart Workshop

Var_Int := Var_Real

(This equation appears as invalid in the action editing window)

4.13.2 Explicit Conversion

When an explicit conversion is necessary, a conversion operator must be used. The


syntax for conversion is as follows:
TO_[TYPE_VARIABLE]([Variable or operator to convert])

Examples:

If we consider the previous example of converting “Var_Real” (type REAL) to “Var_Int”


(type INT), the syntax is:
• Var_Real := 2.718;
• Var_Int := TO_INT(Var_Real);
• The resulting value for Var_Int will be 2.

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

ESC External security condition.

FORCED Signals that a SFC is forced if any of its steps is forced. This
step must not depend on RUN.

A SFC cannot force itself, nor with a SFC at a hierarchical


level equal to or greater than itself.

Two or more SFCs with the same hierarchical level cannot


force an identical SFC.

If a SFC is forced by two or more SFCs, the forcing by the


SFC at the highest level of the hierarchy has priority.

© Famic Technologies inc. 5-1


Automation Studio™ – Sequential Function Chart Workshop

Variable Description

GEN_FAULT General SFC fault.

If a fault is present but not acknowledged, or if the


external security condition is present, GEN_FAULT is
automatically set to TRUE according to the following
equation :

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

.SFC1.RUN := NOT .SFC1.GEN_FAULT

.SFC1.INIT := NOT .SFC1.GEN_FAULT

INIT The initialization command : Activates the initial steps, and


inactivates the others.

This variable is set to TRUE by the simulator on the first


simulation cycle.

Except for the SFC at hierarchical level zero, the INIT


command can be triggered by an action, or by another SFC.
A SFC cannot initialize itself.

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.

Except for SFC at hierarchical level zero, the RUN command


can be triggered by an action, or by another SFC. A SFC
cannot run itself.

RUNNING State of a SFC being executed.

SEQ_MAX_ACK Acknowledgement command for the maximum sequence


duration fault.

SEQ_MAX__ACK_MEM Acknowledgement memorization of the maximum


sequence duration fault.

SEQ_MAX_FAULT Maximum sequence duration fault.

SEQ_MIN_ ACK Acknowledgement command for the minimum sequence


duration fault.

SEQ_MIN_ ACK_MEM Acknowledgement memory of the minimum sequence


duration fault.

SEQ_MIN_FAULT Minimum sequence duration fault.

STEP_MAX_ ACK Acknowledgement command for the maximum step


duration fault.

STEP_MAX_ ACK_MEM Acknowledgement memorization of the maximum step


duration fault.

STEP_MAX_ FAULT Maximum step duration fault (only one fault for all steps
under monitoring).

© Famic Technologies inc. 5-3


Automation Studio™ – Sequential Function Chart Workshop

Variable Description

STEP_MIN_ ACK Acknowledgement command for the minimum step


duration fault.

STEP_MIN_ ACK_MEM Acknowledgement memorization of the minimum step


duration fault.

STEP_MIN_ FAULT Minimum step duration fault (only one fault for all steps
under monitoring).

 Variables associated with a SFC are denoted by “.nameOfSFC.FORCED”.

 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.

 Variables created with a component are denoted by “.nameOfSFC.Xn.X’’.

5-4
Predefined SFC Variables

The variables (n is the step number.) automatically created with a component are listed
below :

Variable Type Description

Xn.X Boolean State of the step.

Xn.T Integer Accumulated activation time of the step.

Xn.BREAK_PT Boolean The step is associated with a break point.

Xn.FORCED Boolean Forced state of the step.

 Variables created with a component are denoted by “.nameOfSFC.Xn.X.”.

© Famic Technologies inc. 5-5


6 Creation of a First SFC
This example will guide you through every step necessary to build your first SFC.

6.1 Operative Part


Before starting to build your first SFC, please open the file SFC_PNEU_EN.prx from the
Pneumatics Workshop, or the file SFC_HYDRO_EN.prx from the Hydraulics Workshop.
These files contain a pneumatic (or hydraulic) circuit, together with a control SFC. They
can be found in the Exercises directory.

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.

Figure 6-1: Sample pneumatic/electric circuit

© Famic Technologies inc. 6-1


Automation Studio™ – Sequential Function Chart Workshop

 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.

The control steps are:

1. Start; BP_1;

2. Activate cylinder A; COM_A;

3. Activate cylinder B; COM_B;

4. Push mass into the left or right bin; M_A or M_B.

It is the SFC’s responsibility to generate these commands and to control the process.

6.2 Creating a new SFC


The following steps explain how to use the various menus and dialogue boxes to create a
new SFC.

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

Figure 6-2: Creating a new SFC

Figure 6-3: Creating a new SFC

The "SFC Templates" dialogue box opens:

© Famic Technologies inc. 6-3


Automation Studio™ – Sequential Function Chart Workshop

Figure 6-4: "SFC Templates" dialogue box

3. Select the SFC Template and press “OK” to close the dialogue box. Automation
Studio™ will create a new SFC document.

6.3 Editing the SFC


The following sections will guide you through the steps to build the SFC shown in the
figure below. Note that no components from the library can be dropped on the SFC
document.

6-4
Creation of a First SFC

Figure 6-5: SFC

 A component from the SFC Workshop can only be connected to a component from
the same Workshop.

© Famic Technologies inc. 6-5


Automation Studio™ – Sequential Function Chart Workshop

6.3.1 Initial Step

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.

Figure 6-6: Initial Step

6.3.2 First Transition

1. On the “Home” tab of AS’s toolbar, click on "Insert Transition Step" in the SFC
Group;

2. Move the mouse pointer to the output connector of step 1;

Figure 6-7: Inserting a Transition

3. Once both connectors are overlapping (initial step output and transition
connector), left-click. Right-click to cancel the insertion tool;

4. Double-click on the inserted transition;

6-6
Creation of a First SFC

Figure 6-8: "Transition Properties" dialogue box, for first transition

5. Ensure that the “Number” is 1;

6. Write the equations for the transition :

 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:

© Famic Technologies inc. 6-7


Automation Studio™ – Sequential Function Chart Workshop

Figure 6-9 : Équation de la transition 1

j. Click in the commentary zone at the bottom and type :


A_IN AND B_IN AND BP_1

7. Click on the icon to apply changes and close the "Component Properties
(Transition – SFC)".

6.3.3 First Action Setup

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.

Figure 6-10 : Step’s Properties

4. Write the equations for the step ;

6-8
Creation of a First SFC

• Create a new Boolean variable OUT_A ;


• Click the "Add variable" button ;
The "Add variable" dialogue box opens.
• In the Variable Type dropdown, select BOOL;
• Enter OUT_A in the "Variable Name" field;
• Click on .
• The new variable appears in the "Statement" field;

Figure 6-11: "Add a variable" dialogue box


• Expand the “Syntax and Operators” zone;
• Click the "IF" button;
• Find the variable COM_A in the list of variables;
• Double-click on the variable.

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

5. Click on to apply changes and close the Component Properties dialogue


box.

 After a symbol such as a step or a transition has been inserted into the SFC, it is

© Famic Technologies inc. 6-9


Automation Studio™ – Sequential Function Chart Workshop

possible to edit its properties with a double-click on it. The Component Properties
dialogue box will open.

The SFC now has three components.

Figure 6-12: SFC with three components

6.3.4 Inserting Other Steps and Transitions

Using the steps described in the two previous sections, insert all the transitions and steps
into the SFC.

Some components should be linked by a convergence or divergence. For now, leave


those components free. You should obtain the following SFC (see next page).

 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.

 In transition number 4, add timers through the steps below.

1. Double-click on transition 4 to open its Component Properties dialogue box;

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;

3. In this syntax, replace n by 4 and a by 1s.

Timers of des transitions 6 et 8 should be done the same way.

6-10
Creation of a First SFC

Figure 6-13: Complete SFC, without branches

© Famic Technologies inc. 6-11


Automation Studio™ – Sequential Function Chart Workshop

6.3.5 Inserting Links

When a component is inserted on the connector of another component, the new


component is automatically linked with the first.

If a component is not inserted on a connector, you must manually link it with another
component.

To create a link between two components :

1. On the “Home” tab of AS’s menu, click on "Pointer Tool" in the


Drawing Group;

2. Place the pointer on the component’s connector;

 In order to facilitate the connection task, component connectors are displayed. A


circle around a connection point represents a connector. A connector that is
correctly linked is displayed using a different color. The mouse pointer changes its
appearance when it hovers on a connector to indicate that the connection tool is
available. To know more, refer to the Layout of Links section in the Automation
Studio™ User’s Guide.

Figure 6-14: Layout of Links - Initial positioning of a link

3. Click the connector on the initial component;

6-12
Creation of a First SFC

Figure 6-15: Layout of Links – Connection with the second component

4. Click the connector on the second component;

Figure 6-16: Layout of Links - Link positioned and selected

5. Click an empty place on the document to deselect the link.

Figure 6-17: Layout of Links - Link positioned and created

 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.

 A "jump" is a link. If the option "Automatic Jump-to Label on Rising Link" is

© Famic Technologies inc. 6-13


Automation Studio™ – Sequential Function Chart Workshop

selected in the SFC options, jumps are automatically created.

6.3.6 Inserting Branches

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:

Figure 6-18 Existing steps

The steps are as follows:

1. Link the transition to the first step on the left;

Figure 6-19 Link steps

2. Link the transition to the second step on the right.

6-14
Creation of a First SFC

Figure 6-20 Step transition

The divergence is automatically created. A convergence is created the same way.

3. You can now link all other components in order to reach the following SFC.

© Famic Technologies inc. 6-15


Automation Studio™ – Sequential Function Chart Workshop

Figure 6-21: SFC with its entire links

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.

6.3.7 Inserting Structured Texts

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.

To insert a structured text:

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;

3. To quit the "Structured Text" insertion mode, make a right click;

4. Double-click on the new Structured Text to reach its "Component Properties


(Structured Text - SFC) “ dialogue box.

© Famic Technologies inc. 6-17


Automation Studio™ – Sequential Function Chart Workshop

Figure 6-22: "Structured Text Properties" dialogue box

5. Enter the command .SFC1.RUN := 1;

6. Go to the “Comment:” group;

7. Enter a comment in the appropriate field. For instance, Unconditional SFC run;

8. Click on the icon.

The Structured Text is displayed.

6-18
Creation of a First SFC

Figure 6-23: Example of a Structured Text

6.3.8 Inserting Free Comments

Free Comments are not linked to any transition or step.

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;

3. To quit the Comment insertion mode, make a right click;

4. Double-click on the new Comment to reach its Component Properties (Comment


– SFC) dialogue box.

Figure 6-24: "Comment Properties" dialogue box

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.

© Famic Technologies inc. 6-19


Automation Studio™ – Sequential Function Chart Workshop

The comment will be displayed at the appropriate place.

Figure 6-25: Example of a Comment

6.3.9 Components links

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:

1. Open the Component Properties of the valve A;

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 ;

5. Close the Components Properties window with the upper x;

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

Figure 6-26 : Solenoids of the A valve linked with SFC variables

Link variables the same way for other solenoids of the valves and cylinders, as shown on
the following diagram:

Figure 6-27 : All solenoids linked to SFC variables

© Famic Technologies inc. 6-21


Automation Studio™ – Sequential Function Chart Workshop

6.4 Check for Errors


At any time it is possible to check for errors such as missing links between steps and or
transitions, or undeclared variables.

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.

Figure 6-28: Example of errors in the "Messages" window

For more information, refer to the Automation Studio™ User's Guide.

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.1 State of an SFC During Simulation


During simulation, all states of an SFC having the logical value TRUE are displayed in the
schematic. These states disappear when logical value returns to FALSE.

Figure 7-1: An SFC's States during Simulation

7.2 Step and Transition States During Simulation


An activated component is shown with the color that is defined by the "Active
Component Color" property. This property can be modified in the "SFC Simulation" branch
of the options menu. The default color is red.

The following is a state representation of steps during simulation.

© Famic Technologies inc. 7-1


Automation Studio™ – Sequential Function Chart Workshop

Component Representation Description

Active Step An active step is represented by a


fixed red square.

Forced active A forced step is displayed as a


step flashing red square.

Active macro An active macro step is displayed


step as a red rectangle in the middle
part of the step symbol.

Active IN The entry step of a macro step SFC


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

Active OUT The exit step of a macro step SFC


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

Step with When a step with a break point is


break point activated, the simulation is
suspended including all concurrent
temporizations.

Step with When the step number is locked, it


locked is not renumbered if the
number renumbering function is executed.

7-2
Simulation

Component Representation Description

Active A transition with a TRUE validated


transition transition condition.

Active Highlighted representation.


variable

 Note that a transition is an instantaneous event. Only in the step-by-step


simulation mode can it be viewed.

 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.

7.3 Fault Management During Simulation


7.3.1 Sequence Duration Monitoring

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.

© Famic Technologies inc. 7-3


Automation Studio™ – Sequential Function Chart Workshop

Minimum Sequence Duration Fault

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.

For this monitoring, we use the following internal variables:

1. SEQ MIN FAULT: Minimum sequence duration fault.

2. SEQ MIN ACK: Acknowledgement command for the minimum sequence


duration fault.

3. SEQ MIN ACK 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 monitoring:
• Acknowledgement memory for the minimum sequence duration fault.

SEQ MIN ACQ MEM IF SEQ MIN ACK


OR
(SEQ MIN ACK MEM AND SEQ MIN FAULT)

• Detection of the minimum sequence duration fault.

SEQ MIN FAULT IF (RUNNING AND NOT SEQ TMIN Q AND


X1.X AND NOT INIT)
OR
(SEQ MIN FAULT AND NOT SEQ MIN 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.

7-4
Simulation

 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.

Maximum Sequence Duration Fault

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.

For this monitoring, we use the following internal variables:

1. SEQ MAX FAULT: Maximum sequence duration fault.

2. SEQ MAX ACK: Acknowledgement command for the maximum sequence


duration fault.

3. SEQ MAX ACK 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 monitoring:
• Acknowledgement memorization for the maximum sequence duration fault.

SEQ MAX ACK MEM IF SEQ MAX ACK


OR
(SEQ MAX ACK MEM AND SEQ MAX
FAULT)

• Detection of the maximum sequence duration fault.

© Famic Technologies inc. 7-5


Automation Studio™ – Sequential Function Chart Workshop

SEQ MAX FAULT IF SEQ TMAX Q


OR
(SEQ MAX FAULT AND NOT 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.

7.3.2 Step Duration Monitoring

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.

Minimum Step Duration Fault

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.

For this monitoring, we use the following internal variables:

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

3. STEP MIN ACK 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
monitoring:
• Acknowledgement memorization for the minimum step duration fault.

STEP MIN ACK MEM IF STEP MIN ACK


OR
(STEP MIN ACK MEM AND STEP MIN
FAULT)

• Detection of the minimum step duration fault.

STEP MIN FAULT IF STEP MIN Y?.COND FAULT


OR
(STEP MIN FAULT AND NOT STEP MIN ACK
MEM)
Where Y?.COND FAULT exist for each
transition preceeding a step that includes
a step minimum duration monitoring.

 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.

Maximum Step Duration Fault

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.

© Famic Technologies inc. 7-7


Automation Studio™ – Sequential Function Chart Workshop

For this monitoring, we use the following internal variables:

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.

3. STEP MAX ACK 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
monitoring:
• Acknowledgement memorization of a maximum step duration fault.

STEP MAX ACK MEM IF STEP MAX ACK


OR
(STEP MAX ACK MEM AND STEP MAX
FAULT)

• Detection of the maximum step duration fault.

STEP MAX FAULT IF T1


OR
T2
OR …. OR
Tn
OR
(STEP MAX FAULT AND NOT STEP MAX ACK
MEM)

Where T1 is the variable T of the step X1,


T2 is the variable T of step X2 and Tn is
the variable T of the step Xn.

 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.

 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.

7.3.3 General Fault

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:

GEN FAULT STEP MAX FAULT


OR
STEP MIN FAULT
OR
SEQ MIN FAULT
OR
SEQ MAX FAULT
OR
ESC

 The external security condition “ESC” can be assigned inside an SFC or in a


structured text.

7.4 Windows Layout


Before switching your first project into simulation mode you have to reorganize all
windows in such a way that it is possible to view the operational schematic and the SFC
simultaneously.

© Famic Technologies inc. 7-9


Automation Studio™ – Sequential Function Chart Workshop

Figure 7-2: Window Layout

7.5 Project Simulation


Project management in simulation mode is the same for all Automation Studio ™
environment. For further details, please refer to the Automation Studio™ User’s Guide.

To simultate the previously created pneumatic project:

1. Click on the simulation button. The SFC is started and the initial step 1 is
activated;

2. Click on the Push Button PB_1. Step 2 is now activated;

3. Click on COM_A. Cylinder A raises the load;

4. Click on COM_B. Cylinder B pushes the load on the right;

5. During steps 4 and 5, both cylinders retract to their initial positions;

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

7.6 Possible Problem Causes


7.6.1 Structure Errors

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.

Problems can show up when such an SFC is simulated or executed. It is imperative to


have the newly edited SFC conform to the norm. When an SFC is in simulation mode,
error and/or warning messages are displayed in the “Messages” window, while the
simulation is pursued in respect with the fives rules of evolution of SFC. These are as
follows:
• The initial situation of an SFC characterizes the initial behavior of the command
section with regard to the operative section, the operator interaction and/or the
external elements. They correspond to the active steps at the very beginning of
all operations: these steps are the initial steps;
• A transition is said to be validated when the steps immediately preceding are all
active. The evolution of a SFC can proceed through a transition:
a. When the transition is validated;
b. And the associated transition condition has the value TRUE.
• The crossing of a transition simultaneously activates all steps immediately
following it, and deactivates all steps preceding it;
• If multiple transitions are simultaneously validated with the result TRUE, they will
all be proceeded through simultaneously;
• If a step is simultaneously activated and deactivated while in operation, the step
will be kept active.

7.6.2 Syntax Errors

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

© Famic Technologies inc. 7-11


Automation Studio™ – Sequential Function Chart Workshop

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.

Figure 8-1: “Export…” command of 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.

© Famic Technologies inc. 8-1


Automation Studio™ – Sequential Function Chart Workshop

Figure 8-2: “SFC” Group of the “Export-Format Selection” Dialogue Window

The “SFC” group offers two format types for SFC documents: Export (GIE) and Siemens
STEP 7 (3xx and 4xx).

SFC documents can also be exported into Allen-Bradley Ladder format.

8.1 Export GIE


The Export GIE is an “XML” format with many advantages:
• It is standard;
• It is used by numerous applications;
• It is flexible to be able to find results in a search even when data is missing;
• It can be processed by many different application tools;
• Information can be added without disturbing the layout of an older application.

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

Figure 8-3: “Export-Document selection” Dialogue Box

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).

 It is important to know that an SFC containing non-blocking errors can be exported.


It is the responsibility of the user to verify that the SFC does not contain any errors.
Automation StudioTM offers diagnostic tools to help detect some of them, but does
not detect all possible errors.

8.2 Export Siemens STEP 7 (3xx and 4xx)


The goal of the Siemens STEP 7 export function is to export the SFC document(s) created
in Automation Studio™ to a format compatible with the S7 function charts of the Siemens
STEP 7 (version 3xx and 4xx) software. To maintain consistency, some specific functions
of Automation Studio™ graphs need a transformation.

© Famic Technologies inc. 8-3


Automation Studio™ – Sequential Function Chart Workshop

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.

8.2.2 Export Process

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.

Figure 8-4: “Export-Document selection” Dialogue Window

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

Figure 8-5: First Dialogue Window of Siemens Step 7 Options

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.

© Famic Technologies inc. 8-5


Automation Studio™ – Sequential Function Chart Workshop

Figure 8-6: “ExportOutput Destination” Dialogue Box


The various options and functions of this dialogue window are:

Item Description

Export to Directory: Data field to input the destination directory for the files
to be exported.

Search… Button allowing to search the directory tree of the


computer and/or the network in order to select the
destination directory.

< Back Button allowing to go back to the previous dialogue


window.

Finish Button allowing to proceed to exporting files to the


destination directory if no blocking errors are detected.

Cancel Button allowing to close the dialogue window and exit


the wizard without exporting the document(s).

8-6
Export

Item Description

Button allowing to access help for the export wizard.

Button allowing to close the dialogue window and exit


the wizard without exporting the document(s).

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).

The absence of this file does not block compiling the


other files in Siemens STEP 7.

02_BLOCKS.SCL This file contains the function and data blocks associated
with the graphs. It contains also the DB1 data bloc.

If Automation Studio project requires exporting in


separate graphs, a “##_BLOCKS.SCL” file is created for
each graph.

03_GRAPHS.GR7 This file contains the graph’s data in S7-Graph format. It


contains all steps, transitions and instructions of the
graph. This file is encoded in ANSI format and can be
easily edited in a text editor program.

If Automation Studio project requires exporting in


separate graphs, a “##_GRAPHS.GR7” file is created for
each graph.

© Famic Technologies inc. 8-7


Automation Studio™ – Sequential Function Chart Workshop

File Description

04_OB1.SCL This file contains the information and initialization of the


API main cycle’s SFC blocs (FBxx/DBxx) so that the
exported sequential functional chart is ready to be used.

The export tool generates a “##_OB1” file for each


Automation Studio exported project in the format
selected by the user.

 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.3 Export Ladder (Allen-Bradley)


SFC documents can also be exported into Ladder Format (Allen-Bradley). As for GIE and
Siemens STEP 7 formats, the user clicks on the “Export…” command from the Automation
Studio™ Menu. This opens the following dialogue window in which the “Allen-Bradley
Ladder” format can be selected.

8-8
Export

Figure 8-7 Allen-Bradley Export-Format Selection

The user selects the SFC document(s) that should be exported, then clicks on the “Next >”
button.

Figure 8-8 Export-Document Selection Window

© Famic Technologies inc. 8-9


Automation Studio™ – Sequential Function Chart Workshop

The options windows opens. It is composed of three groups of options.

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.

Figure 8-9 Forcing Logic of a Step

The “Export to Directory” group allows selecting the export folder.

8-10
Export

Figure 8-10 General Options Window for Allen-Bradley Ladder Export

Then, a click on the “Finish” button will generate the resulting export files in the selected
export directory.

© Famic Technologies inc. 8-11


A Glossary
Action

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.

Every action associated to a step is executed when that step is active.

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 top of the symbol identifies an active in step.

A red token on the bottom of the symbol identifies an active out step.

Alphanumeric

Characters comprised by the combined set of the 26 alphabetic characters, A to Z, and


the 10 numerals, 0 to 9.

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.

© Famic Technologies Inc. A-1


Automation Studio™ – Sequential Function Chart Workshop

Automatism

A device, system, or equipment that allows an apparatus to execute specific operations


without the intervention of an operator.

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

A number designated for each point where components are connected.

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

A graphic representation of a circuit or a model by means of elements and components


drawn from the Automation Studio™ workshop libraries. Only SFC components can be
placed in an SFC 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

Mode of operation in which the components are inserted and changed.

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.

The general forcing statement syntax is: F/SFC_Name:(X_i,X_j,…).

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

Level of an SFC in a forcing hierarchy. The top level is 0.

© Famic Technologies inc. A-3


Automation Studio™ – Sequential Function Chart Workshop

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

The In step is represented by a number inside a square with a rectangle on top. It is


inserted with the use of the In Step button of the SFC toolbar. It is used in the SFC that
triggers the macro 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

A link connects components. During simulation, it is used to transfer information from


one component to the other.

Link shape

Path of a link between two points.

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

A group of documents forming a cohesive whole. A Project is managed by the Diagram


Editor.

Project Explorer

Content of one of the project editor's windows. The document manager lists all of the
documents in the project.

Project Label

Brief description of the project appearing in the project summary.

Properties

Characteristics or parameters of a component. You can change or view the properties by


opening the component properties dialogue box.

RUN

SFC evolution permission. Without this permission, the SFC is frozen and no steps or
transitions are processed.

© Famic Technologies inc. A-5


Automation Studio™ – Sequential Function Chart Workshop

Sequence Maximum Duration

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.

Sequence Minimum Duration

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

Mode of operation in Automation Studio™ during which a project or a diagram is


simulated. Unlike the Edit mode, the Simulation mode, when it is active, does not allow
any change to the project.

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.

Step Maximum Duration

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.

Step Minimum Duration

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

Must be satisfied (TRUE) to be cleared and to activate the next step.

Transition Condition

A transition condition is a logical condition that determines the evolution of an SFC


through a transition. It is a Boolean expression written with the help of input variables,
step variables Xn, logical operators, timer operators and edge operators. They can be true
or false.

User Interface

Environment made up of windows, dialogue boxes, graphic objects, etc., with which the
user communicates with the software.

© Famic Technologies inc. A-7


Automation Studio™ – Sequential Function Chart Workshop

Utility

A general designation for the different types of windows in Automation Studio™ .

Worksheet

The entire surface available in Automation Studio™ for generating diagrams.

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

© Famic Technologies inc. B-1


Automation Studio™ – Sequential Function Chart Workshop

B-2
Variable Operators

© Famic Technologies inc. B-3


Automation Studio™ – Sequential Function Chart Workshop

B-4
Variable Operators

© Famic Technologies inc. B-5


C Type Conversion

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

LINT B T8 T16 T32 I T8 T16 T32 I ISR64 ISL64 VT LS T8 T16 T32 I LW I 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

ULINT B T8 T16 T32 IS T8 T16 T32 I IR64 IL64 VT LS T8 T16 T32 I LW IS D X

REAL B RS8 RS16 RS32 RS64 R8 R16 R32 R64 I R VT LS LW RS64 D X

LREAL B RS8 RS16 RS32 RS64 R8 R16 R32 R64 L I VT LS LW RS64 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

WORD T1 T8 I E32 E64 T8 I E32 E64 T8 I E32 E64

DWORD T1 T8 T16 I E64 T8 T16 I E64 T8 T16 I E64

LWORD T1 T8 T16 T32 I T8 T16 T32 I T8 T16 T32 I

WSTRING WL WL WL WL WL WL WL WL WL WL WL WL WL WL WL WS I WL WL

CURRENCY B TD8 TD16 TD32 I TD8 TD16 TD32 I ISR64 ISL64 LS LW I D

DECIMAL TD8 TD16 TD32 TD64 TD8 TD16 TD32 TD64 MR ML LS LW TD64 I

ENUM T8 IS ES32 ES64 T8 I E32 E64 IR16 IL16 LS LW X

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

© Famic Technologies inc. C-1


Automation Studio™ – Sequential Function Chart Workshop

BSS : Conversion of VT_BSTR into STRING; the most significant byte is truncated

BSW : Conversion of VT_BSTR into WSTRING

BVB : If the value is Zero, the boolean takes value 0; if not, it takes value 0xFFFF

D : Special treatment for DECIMAL conversion

E8 : Extended with zeros in the 8 most significant bits

E16 : Extended with zeros in the 16 most significant bits

E32 : Extended with zeros in the 32 most significant bits

E64 : Extended with zeros in the 64 most significant bits

EL : Extended with zeros as INT and converted into LREAL

ER : Extended with zeros as INT and converted into REAL

ES16 : Extended sign over 16 bits

ES32 : Extended sign over 32 bits

ES64 : Extended sign over 64 bits

I : Same value bit to bit

IL8 : Conversion of USINT into INT and of INT into LREAL

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]

IR8 : Conversion of USINT into INT and of INT into REAL

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]

IS : Implicit, the most significant bit becomes the sign bit

ISL8 : Conversion of SINT into INT and of INT into LREAL

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]

ISR8 : Conversion of SINT into INT and of INT into REAL

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

LBS : The value is converted into a litteral value in a VT_BSTR

LS : The value is converted into a litteral value in a STRING

LW : The value is converted into a litteral value in a WSTRING

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

MS64 : The sign is extended

R : Conversion into LREAL or VT_R8

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

T1 : Truncated, preserved the least significant bit

T8 : Truncated, preserved the 8 least significant bits

TD8 : Rounded to the closes 8 bit signed integer. If the value is too large or too small, an error is generated

T16 : Truncated, preserved the 16 least significant bits

TD16 : Rounded to the closes 16 bit signed integer. If the value is too large or too small, an error is generated

T32 : Truncated, preserved the 32 least significant bits

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

© Famic Technologies Inc. C-3


Automation Studio™ – Sequential Function Chart Workshop

WBS : Conversion of a STRING into VT_BSTR

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

WS : Conversion of a WSTRING into STRING. The most significant byte is truncated

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

XD : Extraction of the DATE

XDA : Conversion to the format DATE

XDDA : Extraction of the DATE

XDVD : TIME to 0 and extraction of the DATE in the format VT_DATE

XDT : DATE to 0 and extraction of the TIME

XT : Extraction of the TIME

XTD : TIME to 0 and extraction of the DATE

XTDA : Extraction of the TIME

XTVD : DATE to 0 and extraction of the TIME in the format VT_DATE

XVD : Conversion into VT_DATE

Conversion Impossible

Implicit Conversion http://msdn2.microsoft.com/fr-fr/library/y5b434w4(VS.80).aspx

Explicit Conversion http://msdn2.microsoft.com/fr-fr/library/yht2cx7b(VS.80).aspx

C-4
Index

D Index
Actions ............................................... 3-14 Boolean Animation ........................... 3-10

Active Component Color ................... 3-10 Boolean Expressions Operators ........ 4-16

Active Step Scrolling ......................... 3-10 Break Point ........................................ 3-14

Adjust................................................... 3-2 Class ................................................... 3-12

All ......................................................... 3-4 Command Part .................................... 2-1

Allen-Bradley....................................... 8-8 Comment2-12, 3-3, 3-4, 3-15, 3-21, 3-


30
Alternate Step/Transition ................... 3-2
Component Color ................................ 3-9
Alternate Transition/Step ................... 3-3
Conditional Boolean Assignment ..... 4-23
Appearance ....................................... 3-13
Conditions.......................................... 3-21
Apply Colors to Syntax Elements ....... 3-9
Convergence
Assignment
AND ................................................ 2-11
Array Dynamic Assignment .......... 4-28
OR................................................... 2-11
Array Static Assignment................ 4-27
Conditional Numerical ................... 4-24 Convert Link or Jump ................... 2-5, 3-2
Continuous Boolean ...................... 4-22 Convert Step ........................................ 3-3
Enumeration .................................. 4-25
Defined Variable Color ........................ 3-9
Numeric ......................................... 4-23
Stored Boolean .............................. 4-24 Display Comments, Level 1 ................ 3-9
Structure ........................................ 4-26
Display Statements (action, transition),
Associated Macro Step Graph ........... 3-14 Level 2 ................................................. 3-9

Auto Fit Branches ................................ 3-8 Divergence


AND ................................................ 2-11
Auto Jump-to Label on Rising Link ..... 3-8
OR................................................... 2-11
Base Fit Redraw ........................ 2-6, 3-2
Duration

© Famic Technologies inc. D-5


Automation Studio™ – Sequential Function Chart Workshop

Sequence Duration .......................... 7-3 Ladder .................................................. 8-8


Step Duration ................................... 7-6
Link ............................................ 2-11, 3-5
Edge Operator .................................... 4-17
Lock Number ....................................... 3-6
Enclosure............................................ 4-36
Maximum Activation Time................ 3-19
Elements ........................................ 4-36
Initial Activation Link ... 2-10, 3-3, 4-37 Maximum Sequence Time ................ 3-12
Initial Enclosing Step ... 2-10, 3-3, 4-37 Minimum Activation Time ................ 3-19
Rules ............................................... 4-37
Minimum Sequence Time ................. 3-12
Standard Activation Link2-10, 3-3, 4-
37 More/Less3-17, 3-18, 3-23, 3-24, 3-28,
Standard Enclosing Step2-10, 3-3, 4- 3-29
37
Number .................................... 3-14, 3-21
Export ................................................... 8-1
Number Color ...................................... 3-9
Export Allen-Bradley ........................ 8-8
Export GIE ......................................... 8-2 Number Lock ........................... 3-14, 3-21
Export Ladder ................................... 8-8 Numerical Animation ........................ 3-10
Export Siemens Step 7 S7-Graph .... 8-3
OPC ....................................................... 4-7
Fault Variables ................................... 4-33
Operative Part ..................................... 2-1
Follow .................................................. 3-5
Operators3-17, 3-18, 3-23, 3-24, 3-28,
Forcing 3-29
Syntax ............................................ 4-41 Advanced Mathematical Expressions 4-
9
General Fault ....................................... 7-9
Basic Arithmetic Expressions .......... 4-8
GIE ........................................................ 8-2 Color ................................................. 3-9

Graph Name .................. 3-14, 3-20, 3-25 Priority............................................ 4-21


Relational ....................................... 4-18
Hierarchic Level ................................. 3-11
Renumber ............................................ 3-6
Identifier Naming ................................ 4-1
SFC Simulation Mode ........................ 3-12
Jump ................................................... 2-12
Siemens Step 7 S7-Graph ................... 8-3

D-6
Index

Standards........................................... 3-11 Introduction ..................................... 4-1


Reserved Keywords ........................ 4-4
State Variables .................................. 4-33
Transition ......................................... 4-3
Statement .......................3-15, 3-22, 3-27 Variable ............................................ 4-6
Step...............................................3-4, 4-2 Syntax Errors ..................................... 7-11
Active IN Step .................................. 7-2
Time Supervision .............................. 3-15
Active Macro Step ........................... 7-2
Active OUT Step ............................... 7-2 Timers ................................................ 4-30
Active Step............................. 2-10, 7-2
Timing ................................................ 4-30
Forced Active Step........................... 7-2
In ...................................................... 2-9 TOF ..................................................... 4-31
In Step .............................................. 3-3 TON .................................................... 4-31
Initial .........................................2-9, 3-3
TP ....................................................... 4-32
Initial Activation Link............. 2-10, 3-3
Initial Enclosing Step ............. 2-10, 3-3 Transition .................... 2-10, 3-3, 3-4, 4-3
Macro Step ...................... 2-9, 3-3, 4-34 Active Transition.............................. 7-3
Out ................................................. 2-10 Type ................................................... 3-14
Out Step ........................................... 3-3
Source Step .................................... 3-12 Unconditional Action......................... 3-16

Standard....................................2-9, 3-3 Unconditional SFC Run ...................... 3-12


Standard Activation Link ....... 2-10, 3-3
Undefined Variable Color .................... 3-9
Standard Enclosing Step........ 2-10, 3-3
Step with Break Point ..................... 7-2 Unlock Number ................................... 3-7
Step with Locked Number .............. 7-2 Variable ............................................... 4-6
Structure Errors .................................. 7-11 Active Variable ................................ 7-3
Name/Alias ................ 3-17, 3-23, 3-28
Structured Text . 2-11, 3-3, 3-4, 3-26, 4-3
Predefined ....................................... 5-1
Syntax .............................3-18, 3-24, 3-29 Type ................................................. 4-6
Comment ......................................... 4-4
Constants ......................................... 4-8
Forcing ........................................... 4-41

© Famic Technologies inc. D-7


© Famic Technologies inc. D-8

You might also like