Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
185 views

ALSPA Control System Controcad SFC Sequential Language Behavior

Uploaded by

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

ALSPA Control System Controcad SFC Sequential Language Behavior

Uploaded by

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

Section 1

Section 2
Section 3
Section 1
Section 2
Section 3
Section 1
Section 2
Section 3
Section 1
Section 2
Section 3
ALSPA Controcad

SFC

Sequential Language Behavior

ACCESSIBILITY Free

DATE 2007-08-22

NAME SIGNATURE
CREATED BY S. COUFFIN
CHECKED BY L. HOLZ

APPROVED BY H. SABOT

DOCUMENT TYPE
ALSTOM DOCUMENT CODE

Format Status SH/SH END N of SH


REFERENCE LG REV ORIGIN
Size
PTP21A40087 en D PCS/CSD/CSD-2 A4 GFE 1/24 24

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein.
Reproduction, use or disclosure to third parties without express authority is strictly forbidden
Template No.: CS-T-010 Rev.C (Procedure CS-P-009)
REVISION HISTORY

REV CREATED BY CHECKED BY APPROVED BY DATE DESCRIPTION STAT.

First version: replace the document PTP21A40559


(deletion of useless information for users)
A S. COUFFIN L. HOLZ H. SABOT 2004-08-31 GFE
Add of an example of forcing order on several SFC
graphs in paragraph 2.4.1.

Add of the operator ! (transport validator) in the


B S. COUFFIN L. HOLZ H. SABOT 2004-10-19 GFE
language BEL in the version 4.2.1 of Controcad

Change the reference to the User's Manual since a


reorganization of the documentation was done in
C S. COUFFIN L. HOLZ H. SABOT 2007-05-22 version 4.3.1. GFE
Add of information on the "Locked Step Semantic"
algorithm.

Deletion of a sentence in French


D S. COUFFIN L. HOLZ H. SABOT 2007-08-22 New ALSTOM graphical format GFE
Orthographic corrections

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 2/24
SOMMAIRE / TABLE OF CONTENTS

Section 1 Foreword................................................................................................................. 5
Section 2 Elements of the Controcad SFC Editor................................................................. 6
2.1 Step ..........................................................................................................................................................6
2.1.1 Identification ..............................................................................................................................6
2.1.2 Initialization ...............................................................................................................................6
2.1.3 Step Activity Variable ................................................................................................................6
2.1.4 Elapsed Time since Step Activation Variable ...........................................................................6
2.1.5 Associated Comment................................................................................................................7
2.1.6 Associated Action and Forcing Order .......................................................................................7
2.1.7 Pit and Source Step ..................................................................................................................7
2.2 Transition..................................................................................................................................................7
2.2.1 Identification ..............................................................................................................................7
2.2.2 Transition Condition ..................................................................................................................7
2.2.3 Clearability ................................................................................................................................8
2.2.4 Transitions Belonging to a Sequence Selection .......................................................................8
2.2.5 Associated Comment................................................................................................................8
2.2.6 Pit and Source Transition..........................................................................................................9
2.3 Step-Transition Link..................................................................................................................................9
2.4 Forcing Order ...........................................................................................................................................9
2.4.1 Principle ....................................................................................................................................9
2.4.2 Consistency of the Forcing Order Hierarchy...........................................................................11
2.4.3 No Simultaneous Forcing Orders on the same SFC ..............................................................12
2.4.4 Effect on the Rules to update Situation ..................................................................................13
2.5 Boolean Action .......................................................................................................................................13
2.5.1 Principle ..................................................................................................................................13
2.5.2 Concrete Examples.................................................................................................................14
2.5.3 Correspondence between Standard Qualifiers and Controcad Qualifiers..............................14
2.5.4 Calculation of the Value of the Action Variable.......................................................................16
2.5.5 Behavior of an Action Associated to an Initial Step ................................................................17
2.5.6 Behavior of an Operation S Action of a Forced SFC ..............................................................17
2.5.7 Behavior of a Phase P0 Action in a Forced SFC....................................................................19
2.5.8 Associated Comment..............................................................................................................19
2.6 FBD Diagram Type Action......................................................................................................................19
2.6.1 Principle ..................................................................................................................................19
2.6.2 Warning: initialization code of FBs..........................................................................................20
2.6.3 Order of Boolean/FBD Actions................................................................................................20
2.6.4 Order of FBD Diagram Write/Execute Instructions .................................................................20
Section 3 Controcad Code Generation................................................................................ 22
3.1 SFC Diagram Structure ..........................................................................................................................22
3.1.1 Consistent SFCs .....................................................................................................................22
3.1.2 Composition of a POU integrating SFC Diagrams..................................................................22
3.1.3 Consistency of an SFC Type POU .........................................................................................22
3.1.4 Using the FBD.........................................................................................................................23

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 3/24
3.2 Interpretation of the SFC POU in the PLC .............................................................................................23
3.3 Redundancy ...........................................................................................................................................24

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 4/24
abcd

Section 1 Foreword

ALSTOM has implement a sequential language in the Controcad programming tool.


It was decided that this language should be defined on the basis of the following
standardized languages:

• GRAFCET (IEC 60848 standard and document UTE C03-191),

• SFC (IEC 61131-3 standard),

It was also decided to integrate to the greatest possible extent the needs of the
different users of Controcad.
The aim here is to present the functionality, especially the dynamic aspects, of the
Controcad sequential language.
This document presumes that the reader is familiar with the principles of GRAFCET
and SFC as these principles are formulated in the standards mentioned above.
For a better understanding of the document, it is recommended to read the
document PTP21-A40041 describing the main features of the SFC editor.
The user manual of the SFC editor describing the menus, the ways to manipulate
the SFC elements, … is included in the Controcad User's Manual, Volume 5,
Functional Study (document ref. PTP21A41005).

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 5/24
abcd

Section 2 Elements of the Controcad SFC Editor

2.1 Step

2.1.1 Identification

Each step is identified in the diagram that contains it by its number.

2.1.2 Initialization

Whether or not a step is initial defines whether or not it is active during the initial
controller cycle. Unlike the SFC and in compliance with GRAFCET practice, the
number of initial steps is free. It may even be null.

2.1.3 Step Activity Variable

To enable the generation of code, a Boolean variable is linked to each step. The
value of this variable will be 1 when the step is active, and 0 when inactive.
• The ID tag identifies this variable absolutely relative to all the project variables.
The tag takes following form:

<ID tag of the diagram>_S<number of the step>_X


• The value of this variable can be read in other diagrams but not written.

• This variable is a state variable, it is therefore a redundant variable.

2.1.4 Elapsed Time since Step Activation Variable

When necessary, a "time" type variable can also be associated to store the time that
the step has been active.
• This variable is optional.

• The ID tag identifies this variable absolutely relative to all the project variables
and takes the following form:

<ID tag of the diagram>_S<number of the step>_T


• The value of this variable can be read in other diagrams but not written.

• The behaviors for this variable when the step is deactivated is: the variable retains
its value and is reset to zero on activation of its step. This allows the elapsed time
to be manipulated even after deactivation of the step.

• This variable is a redundant variable.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 6/24
abcd
• Its unit is parameterizable (time unit chosen by project or POU among 10, 100 or
1000 ms).

2.1.5 Associated Comment

A comment is associated to each step. It is possible to choose whether or not this


comment is displayed for printout of the documentation.

2.1.6 Associated Action and Forcing Order

Any number of actions or orders, or none, may be associated to a step.

2.1.7 Pit and Source Step

This function is available (see standard for definition).

2.2 Transition

2.2.1 Identification

Each transition is identified by its number in the diagram that contains it.

2.2.2 Transition Condition

This transition condition is a Boolean whose value is the result of an expression (by
default 1) defined in BEL (Boolean Expression Language).
BEL supports the following operators:
• Boolean expressions AND , OR, NOT, denoted . (AND ), + (OR) and / (NOT)

• Boolean expressions of rising and falling edges, denoted P1 (FM) and P0 (FD)

• Boolean expression delay at excitation or limitation after excitation, denoted D


(DELAY) and L (LIMITER)

• Comparisons of numerical operands, denoted >, >=, <, <=, = and !=

• Transport validator (TRANS_VAL) of Boolean or numerical operands, denoted !

The Boolean AND has priority relative to the OR. Parentheses could be used to
express the desired priorities.
It is possible to define table type variables and therefore to manipulate "v(3)" type
expressions in these expressions.
Expressions can be reduced to operands only, expressed in the form of a variable or
an immediate Boolean value (0 for FALSE and 1 for TRUE) or an immediate
numerical value ( 33 or 3,14 ).

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 7/24
abcd
The advantage of this syntax is that it ignores inducted variables such as previous
rising or falling edge inputs and the current elapsed time for timeout operators.
Example:
V1 + V2.V3 + P1 ( /V4 ) . P0 ( V7+V8) ) + /D (100, V9.V10 ) + L ( V11, V12 )

2.2.3 Clearability

See standard for definition.


Transitions that are simultaneously clearable are simultaneously cleared (except for
transitions belonging to a sequence selection, see following paragraph).

2.2.4 Transitions Belonging to a Sequence Selection

The structure called "sequence selection" is widely used in GRAFCET or in SFC. To


facilitate the design of these sequence selections, a notation has been introduced in
SFC to express the priorities between transitions in the same sequence selection.
No. Example
2b |
+----+
| S5 |
+----+
|
+-----*-----+--...
|2 |1
+ e + f
| |
+----+ +----+
| S6 | | S8 |
+----+ +----+
| |

Extract from IEC standard 61131-3 (table 46)


The utilization of priorities among transitions belonging to the same sequence
selection provides useful assistance during SFC design and has been incorporated
into Controcad. The priority of transitions for a variable sequence selection is
obviously unique. The transition with the highest priority is that with the lowest
numerical priority.
The equivalent generated code uses this priority to choose which sequence to
activate when several transitions in the sequence selection are simultaneously
clearable.

2.2.5 Associated Comment

A comment is associated to each transition. It is possible to choose whether or not


this comment is displayed for printout of the documentation.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 8/24
abcd
2.2.6 Pit and Source Transition

This function is available (see standard for definition).

2.3 Step-Transition Link

An association between a step and a transition is called a link. A link is oriented and
may be displayed in the form of a connection (broken orthogonal line) or as a pair of
referrals (e.g. at the level of the step, a referral identifying the transition and at the
level of the transition, a referral identifying the step).

2.4 Forcing Order

2.4.1 Principle

A forcing order is a non-standard primitive defined only in GRAFCET. Controcad


implements this primitive with enrichments.
Two types of forcing order are defined:
• A deadlocking order that corresponds to the GRAFCET forcing order defined in
document UTE C03-191 and where the forced SFC is locked in the forced
situation while the forcing step remains active.

G2

1 G2

G1
1
G2
2 4

1
3 5 2 4
1

6 3 5
2 4

2
6
3 5

t+1
6

3 N F/G2:{3, 6}
t+2

t+3

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 9/24
abcd
• An arming order that corresponds to setting the forced SFC in the forced situation,
then allowing the forced SFC to update (even if the forcing step remains active).

G2

1 G2

G1
1
G2
2 4

1 3 5 2 4
1

6 3 5
2 4

2
6
3 5

t+1
6
3 P1 F/G2:{3, 6}
t+2

t+3

To differentiate these two types of forcing in Controcad, an ordering moment N is


used for the deadlocking order and an ordering moment P1 is used for the arming
order.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 10/24
abcd
The forced situation is provided by an exact list of the steps to be forced in the
active state. This list may be empty. Other steps of the forced SFC that are not
specified in the list are then forced in the inactive state.

G1 G2

1 10 31
1

2 20
2 32 34

3
3 N F/G2:{3, 32, 34} 33 35

36

Forcing orders are processed before actions (Boolean and FBD type).

2.4.2 Consistency of the Forcing Order Hierarchy

This example shows a forcing chart whose nodes are SFCs and where the arcs
from one node to another correspond to at least one forcing order from the outgoing
SFC to the incoming SFC.

G1

G2

G4 G3

G5 G6

There must be no loops in this forcing chart. The presence of loops is a criterion for
the shutdown of code generation.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 11/24
abcd
2.4.3 No Simultaneous Forcing Orders on the same SFC

It is therefore important that an SFC should not be subject at the same time to two
or more forcing orders that may well be contradictory.
All the forcing orders on the same forced SFC are therefore structured into a
prioritizing hierarchy. These orders can be transmitted from several actions in
several steps of several SFCs. This hierarchy exists within the SFC and also among
all the SFCs. The hierarchy exists by default and can be redefined by the user.
Thus, if two forcing orders on the same SFC happen to have active associated
steps, only one order will be transmitted, i.e. that with the highest priority in the
hierarchy.
G1

1
G2

2 1 N S A

3 N F/G2:{3, 6}
2 4
Priority 2

3 5 N R A
G3

1 6

2 N F/G2:{1}

Priority 1

It is possible to display (in a window) the list of the forcing orders that may apply to
the SFC (« Cross References » menu on the SFC diagram).

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 12/24
abcd
2.4.4 Effect on the Rules to update Situation

The principle implemented is that, in addition to the standard operation of step


activation excluding all forcing orders, a step will be:
• active if there is a deadlocking order or an arming order transmitted to the step
activity.

• inactive if there is a deadlocking order or an arming order transmitted to the step


inactivity.

2.5 Boolean Action

2.5.1 Principle

The action qualifiers defined in SFC do not meet the needs of ours users, that’s the
reason why Controcad defines specific action qualifiers:
• the step activity point at which the operation must take place. This point may also
be known as the action ordering moment:

− when the step is activated (P1),

− while the step is active (N),

− when the step is deactivated (P0),

− limited in time (L), by indicating the duration of this limitation

− delayed in time (D), in indicating the duration of this delay

The duration associated to the qualifiers L and D can be expressed in literal


form1 or via an application variable value.
• the operations executed on Boolean variables:

− set to 1 memorized (Set denoted S),

− set to zero memorized (Reset denoted R),

− set to 1 not memorized (Continue denoted C),

For reasons of security, reset to zero (R) operations take priority over other
operations (S and C).
• the existence of an additional condition before the operation can take place. This
condition is expressed via BEL language.

1
Unit parameterizable by project or POU among 10, 100 or 1000 ms.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 13/24
abcd
2.5.2 Concrete Examples

• case of a Boolean action A set to TRUE while step E is active

E -------- N | C | A this is the standard case of a GRAFCET action


• case of a Boolean action A set and memorized as TRUE when step E becomes
active

E -------- P1 | S | A A memorizes the rising edge of E


• case of a Boolean action A set to TRUE when step E becomes active

E -------- P1 | C | A A is the rising edge of the state of E


• case of a Boolean action A set to TRUE 10s after activation of step E and
remaining at TRUE while the step remains active

E -------- D/10 s | C | A

2.5.3 Correspondence between Standard Qualifiers and Controcad Qualifiers

2.5.3.1 SFC Standard (IEC 61131-3)

See table 45 of the standard.


Standard qualifier Controcad Qualifier
Ordering moment Operation

None N C
N N C
R N R
S N S
L L C
D D C
P P1 C
SD Feasible in another way
DS D S
SL Feasible in another way
P12 P1 C
P02 P0 C
The qualifiers SD and SL cannot be defined in Controcad in SFC only, but they can
be defined by means of an SFC/FBD description.
Some Controcad qualifiers have no equivalent in the standard. These are:
• P1 | S,

• P1 | R,

• P0 | S,

2
Second edition of the standard only.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 14/24
abcd
• P0 | R,

• L | S,

• L | R,

• D | R.

2.5.3.2 GRAFCET Standard (IEC 60848)

See paragraph 5 of the standard.


Standard qualifier Controcad Qualifier
Ordering moment Operation
None N C
S (memorization at 1) N S
S (memorization at 0) N R
R3 N R
D D C
L L C
P P1 C
C Possible, no specific notation
SD Feasible in another way
DS D S or R
SL Feasible in another way
LS L S or R
SP Feasible in another way
PS P1 S or R
SDL Feasible in another way
DSL Feasible in another way
SDP Feasible in another way
DSP Feasible in another way
The qualifiers SD, SL, SP, SDL, DSL, SDP and DSP cannot be defined in
Controcad in SFC only, but they can be defined by means of an SFC/FBD
description.
Standard Cxy (e.g. CDS) qualifiers can be defined in Controcad by the means of xy
qualifiers with an associated action condition (e.g. a standard CDS action is
equivalent of o Controcad DS action with an associated action condition).
Some Controcad qualifiers have no equivalent in the standard. These are:
• P0 | S,

• P0 | R,

• P0 | C.

3
UTE C03-191 document only.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 15/24
abcd
2.5.4 Calculation of the Value of the Action Variable

This calculation is linked to a 'ordering status' for each action, i.e. to TRUE if any
associated condition is at TRUE and if:
• the ordering moment is N when the step is active,

• OR if the ordering moment is P1 when the step becomes active

• OR if the ordering moment is P0 when the step becomes inactive

Important: the utilization of this ordering status implies that the variable associated
to the action may switch to TRUE when the step is inactive. This is a behavior at the
limit of the basic principles of the SFC/GRAFCET.
• OR if the ordering moment is D and the step has been active for a longer period
than the specified delay time,

• OR if the ordering moment is L and the step has been active for a shorter period
than the specified limitation time.

At any given moment, some of the Boolean actions manipulating the same variable
will have TRUE ordering status and others FALSE ordering status.
• if the ordering status of all these actions is FALSE, the variable is equal to 0
(unless it has been previously memorized at 1).

• when the ordering status of some of these actions is TRUE, if at least one of
these actions is type R, the variable is memorized at 0; or if at least one of these
actions is type S, the variable is memorized at 1; otherwise the variable is set
(without memorization) to 1.
Further information
For the actions of the same SFC, the three following resultants are produced:
• Resultant RSE_S from the ordering status with the SET operation, which is TRUE
if at least one SET ordering status is TRUE. If there is no action ordering status
with a SET operation a FALSE value is given to the resultant.

• Resultant RSE_R from the ordering status with the RESET operation, which is
TRUE if at least one RESET ordering status is TRUE. If there is no action
ordering status with a RESET operation a FALSE value is given to the resultant.

• Resultant RSE_C from the ordering status with the C operation, which is TRUE if
at least one C ordering status is TRUE. If there is no action ordering status with a
C operation a FALSE value is given to the resultant.

The value of the action variable is then calculated as follows via the introduction of a
additional state_action Boolean.
The number of controller cycles executed is designated K. The current cycle is taken
into account.
If first cycle
State_action(1) = FALSE
Else
State_action(k) = ( RSE_S + State_action(k-1) ) . / RSE_R
End if

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 16/24
abcd
Variable_action(k) = ( State_action(k) + RSE_C ) . / RSE_R

This gives rise in particular to the following behaviors:


• If a RESET operation action has a TRUE ordering status the action variable is
equal to FALSE (RESET has priority)

• In the absence of RESET operation actions, if a Boolean action on variable V has


a TRUE ordering status then V equals TRUE, even if other inactive steps have
Boolean actions on this same variable V and the ordering status of these actions
is FALSE.

2.5.5 Behavior of an Action Associated to an Initial Step

The clearability of transitions is calculated and the new step variable values are
updated before any calculation of the ordering status of the actions.
This means that the actions associated to the initial steps are not necessarily
executed, in particular if the situation of the SFC has changed during the first cycle.

2.5.6 Behavior of an Operation S Action of a Forced SFC

We have chosen not to prejudge the causes of step inactivity in establishing the
ordering status of the actions.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 17/24
abcd
Concrete example: SFC G1 including step 3 forces SFC G2 to the situation {step 3,
step 6}. We suppose that at the start, step 3 of G1 is inactive and step 1 of G2 is
active. An action in step 1 of G2 does a SET on Boolean variable A. Then the SFC
G1 updates and step 3 of G1 becomes active. The SFC G2 is therefore forced to
active steps 3 and 6. This becomes variable A if step 5 has not been activated
before forcing order ? Variable A remains TRUE until the next RESET.
G2

G1

1 N S A

2 4
2

3 5 N R A
3 N F/G2:{3, 6}

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 18/24
abcd
2.5.7 Behavior of a Phase P0 Action in a Forced SFC

We have chosen not to prejudge the causes of step inactivity in establishing the
ordering status of the actions.
Concrete example: SFC G1 including step 3 forces SFC G2 to the situation {step 3,
step 6}. We suppose that at the start, step 3 of G1 is inactive and step 1 of G2 is
active. An action in step 1 of G2 executes a P0 on Boolean variable A. Then SFC
G1 updates and step 3 of G1 becomes active. SFC G2 is therefore forced to active
steps 3 and 6, and step 1 deactivates. This becomes variable A ? Variable A
switches to TRUE for 1 cycle.
G2

G1

1 P0 C A

2 4
2

3 5
3 N F/G2:{3, 6}

2.5.8 Associated Comment

A comment is associated to each action. It is possible to choose whether or not to


display this comment for the printout of the documentation.

2.6 FBD Diagram Type Action

2.6.1 Principle

In the SFC, an action may correspond to a program, i.e. a list of instructions, whose
execution is conditioned by the activity of the step. This list of instructions is the
code equivalent to the function of a Controcad FBD. A diagram type action, also
called an FBD type, is therefore a sort of Boolean action but, instead of specifying a
Boolean variable, the user specifies an FBD diagram identified by its name.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 19/24
abcd
The mechanisms developed for Boolean actions are adapted:
• a diagram type action Boolean execution status is associated. This execution
status is commanded like a Boolean action, and its state conditions the execution
of the diagram.

• the behavior of the SFC actions should not prejudge knowledge of whether the
causes of step activation/deactivation are or are not the result of forcing orders.

2.6.2 Warning: initialization code of FBs

The action emission mechanism for FBD actions associated to SFCs implies that
the initialization code of FBs is only executed if the FBD action is emitted at the
initial execution cycle of the PLC (i.e. if the action to which the FBD is associated is
active at initialization).

2.6.3 Order of Boolean/FBD Actions

We have chosen, after determining the new situation and the ordering status of the
Boolean and FBD actions, to process all the Boolean actions of the SFC POU then
all the FBD actions of the SFC POU.

2.6.4 Order of FBD Diagram Write/Execute Instructions

The prioritization of the execution of the FBD diagrams in the POU depends on the
ordering moments of the actions. This order is important as it may influence the
value of a variable produced in two distinct diagrams or even produced in one
diagram and read in the second. This means that the action variables are prioritized
by category taking:
• first those that have at least one P0 phase action

• then those that have at least one P1 phase action, and are not included in the
above

• then those that have at least one L phase action, and are not included in the
above

• then those that have at least one phase N action, and are not included in the
above,

• finally the others, i.e. those that have only phase D actions.

Within a category the execution order of the FBDs is defined by the user (execution
number of the FBDs in the POU).

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 20/24
abcd

G1 G1

1 N F/G2:{6} 1 N F/G2:{6}
N C fbd1 N C fbd1
P0 S fbd2 P0 S fbd2

2 P1 C fbd3 2 P1 C fbd3

3 3

t t+1

A t, the forcing order will be transmitted first, then action fbd1.


A t + 1, action fbd2 will be transmitted first, then fbd3.

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 21/24
abcd

Section 3 Controcad Code Generation

3.1 SFC Diagram Structure

3.1.1 Consistent SFCs

Unlike FBD diagrams, the code corresponding to several SFCs may not be
generated diagram by diagram because of SFC behavioral rules. It is therefore
necessary to provide an entity that can be used to group the different SFCs that are
correlated among themselves:
• by common actions (Boolean or FBD),

• by the forcing of an SFC by another SFC,

• by synchronization mechanisms, if the step state of one SFC is used in the


transition condition of another SFC.

A consistent SFC is a full set of correlated SFCs, without exterior references.

3.1.2 Composition of a POU integrating SFC Diagrams

This POU, typed as an SFC POU, invariably contains:


• A list of consistent SFCs

• A ordered list of the FBD actions in the consistent SFCs specified above.

The user defines the SFC set that he needs to see in the POU (complying
nevertheless with the restrictions defined in 3.1.1 and the restrictions imposed by
the used PLC).
The SFCs have no execution number in the POU because the execution order of
the SFCs is defined by the forcing hierarchy. The execution numbers of the FBDs in
the POU are used to define the execution order of the FBDs in a category (see in
paragraph 2.6.4).

3.1.3 Consistency of an SFC Type POU

If the inter-correlated SFCs are not in the same POU, the generation of the POU is
disabled by Controcad since the results can only be bad.
An FBD diagram that is not an action of an SFC of the POU can not be in the POU
(its code could never be executed since it is never be emitted by an action).

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 22/24
abcd
3.1.4 Using the FBD

An FBD is seen in the Controcad target code as a piece of executed code,


exclusively:
• either when the execution status of this FBD is TRUE (for an FBD that is an action
of an SFC),

• or cyclically by the principal program (for an FBD that is not an action of an SFC).

3.2 Interpretation of the SFC POU in the PLC

The interpretation algorithm consists in implementing the following:


At every controller cycle:
1- Evaluate the state of each step
2 - Evaluate the forcing orders to be emitted and their priorities
3 - Calculate the new state of each step by:
3.1 - taking into account the forcing orders for the SFCs on which forcing
orders are applied
3.1 - calculating the transition conditions and clearing the transitions for the
SFCs on which no forcing order is applied
4 - Evaluate the Boolean and FBD actions to be emitted (depends on the state of
the steps, and on the phase and operation of the actions)
5 - Execute the Boolean actions of the POU
6 - Execute the FBD actions of the POU (with the execution order defined in
paragraph 2.6.4 : P0, P1, N, L, D)
This algorithm implies that:
the SFC is working according to the "Locked Step Semantic", that means that a step
becoming active remains active during at least one PLC cycle (one cycle exactly, if
the following transition is clearable) and that if, for example, a sequence of 3 steps is
involved in a transient evolution (3 unstable steps), the number of PLC cycles to go
from first step to third one will be 3.
This is implied by the stage 3 of the algorithm: the value of the activity of each step
is calculate at each PLC cycle. To have a "Maximum Progress Semantic", it should
have had a loop on this stage 3 of the type "as long as transitions are clearable,
calculate the new state of the step".
For this point, we are compliant with the IEC 61131-3: "Testing of the successor
transition condition(s) of an active step shall not be performed until the effects of the
step activation have propagated throughout the program organization unit in which
the step is declared." (paragraph 2.6.5 "Rules of evolution").

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 23/24
abcd
3.3 Redundancy

The implicit (automatically defined by Controcad) redundancy is constituted by the


step variables, the step timers (elapsed time since step activation variables, if
defined, and temporizations), the previous values of the step variables (when P0 or
P1 actions are associated to the step), the previous variable values (when these
variables appear in expressions with P0 or P1), the duration of activation of the
steps when actions D or L are associated to the step and the duration of variables
(when these variables appear in expressions with D or L).
The implicit redundancy is important during the commissioning phase of the project
for the on-line modification. The document « Commissioning guide - Commissioning
P320 » (PTP21A40002S5) contains schemes describing the memory cost of any
add of SFC element (paragraph « Cost of an SFC modification in redundancy »,
page 40 in the A revision of the document PTP21A40002S5-ea).

Copyright © ALSTOM 2007. We reserve all rights in this document and in the information contained therein. Reproduction, use or disclosure to third parties without express authority is strictly forbidden

ALSPA Controcad - SFC PTP21A40087-en Rev.D


Sequential Language Behavior 24/24

You might also like