0% found this document useful (0 votes)
27 views26 pages

T315C-14 Sequential Function Charts - RevE

Uploaded by

Rio Yuwandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views26 pages

T315C-14 Sequential Function Charts - RevE

Uploaded by

Rio Yuwandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

System 800xA Training

Chapter 14 Sequential Function Charts

TABLE OF CONTENTS

Chapter 14 Sequential Function Charts................................................................................................................................... 1


14.1 General Information ................................................................................................................................................... 2
14.1.1 Objectives............................................................................................................................................................ 2
14.1.2 Legend................................................................................................................................................................. 2
14.1.3 Reference Documentation .................................................................................................................................... 2
14.2 Sequential Function Charts (SFC) ............................................................................................................................... 3
14.2.1 General ................................................................................................................................................................ 3
14.2.2 Combinational Logic............................................................................................................................................ 4
14.2.3 Sequential Logic .................................................................................................................................................. 4
14.3 SFC Editor ................................................................................................................................................................. 5
14.3.1 Sequential Rules .................................................................................................................................................. 5
14.3.2 Start the SFC Editor ............................................................................................................................................. 6
14.3.3 Structure Pane...................................................................................................................................................... 6
14.3.4 SFC Toolbar ........................................................................................................................................................ 7
14.3.5 Online Functions.................................................................................................................................................. 8
14.4 Steps and Transitions.................................................................................................................................................. 9
14.4.1 Initial Step ........................................................................................................................................................... 9
14.4.2 Steps.................................................................................................................................................................... 9
14.4.3 Activate Outputs in Step Actions.........................................................................................................................11
14.4.4 Activate Outputs in Separate Code Blocks ...........................................................................................................12
14.4.5 Transition ...........................................................................................................................................................12
14.4.6 Transit between Two Steps..................................................................................................................................13
14.5 Sequence Constructs..................................................................................................................................................14
14.5.1 Simultaneous Sequences .....................................................................................................................................14
14.5.2 Sequence Selection .............................................................................................................................................15
14.5.3 Jumps and Destinations.......................................................................................................................................17
14.5.4 Subsequence .......................................................................................................................................................18
14.5.5 Advice on Good Programming Style ...................................................................................................................18
14.6 SFC Viewer...............................................................................................................................................................19
14.6.1 Activating the SFC Viewer..................................................................................................................................19
14.6.2 Updating the SFC Viewer Aspect ........................................................................................................................20
14.7 Sequence Control Variables .......................................................................................................................................21
14.7.1 Automatically Generated Variables .....................................................................................................................21
14.7.2 Step Timing Variables.........................................................................................................................................22
14.8 Two Direction Sequence Chain..................................................................................................................................23
14.8.1 “SFC Header” Type ............................................................................................................................................23
14.8.2 “SFC Step” Type ................................................................................................................................................24
14.8.3 Predefined Template ...........................................................................................................................................25
14.8.4 Operator Faceplate ..............................................................................................................................................26

Chapter 14 - 1
T315C-14 Sequential Function Charts - RevE

14.1 General Information

14.1.1 Objectives
On completion of this chapter you will be able to:
• Describe the components of SFC
• Create simple sequences
• Use online functions of SFC
• Describe and use the different sequence control variables
• Tell the use of a Two direction SFC

14.1.2 Legend
> Indicates when you go from one menu to a sub-menu
Italic Indicates object and file names
“ “ Indicates dialog box buttons, tabs, menus etc.
Bold Indicates important topics
Indicates start/explanation of student activity

14.1.3 Reference Documentation


3BSE035980 System 800xA Control
AC 800M Configuration
3BSE043732 System 800xA Control
AC 800M Planning
3BSE035981 System 800xA Control
AC 800M Binary and Analog Handling

Chapter 14 - 2
System 800xA Training

14.2 Sequential Function Charts (SFC)

14.2.1 General
The Sequential Function Chart (SFC) programming language allows the user to
describe the sequential behavior of the control program graphically. This is quoted as
the fifth IEC 61131-3 language but it’s not really a new language just a specialized
editor for coding sequences.
The SFC standard has been evolved from Grafcet, a graphical method of describing
sequential behavior.

A sequence is a unit with a complete sequence surrounded by an unconditional loop;


the first step is reactivated when the sequence is finished. A sequence can be divided
into separate types of structures. It is possible to structure the sequence view into
several hierarchical levels with the subsequence function.
NOTE! An SFC block in Control Builder must be programmed
in Structured Text.

Chapter 14 - 3
T315C-14 Sequential Function Charts - RevE

Theoretically, there are two types of logic which are required to solve all process
control problems. These are:

14.2.2 Combinational Logic


In this case, for a given simple or complex logical function, the outputs are solely
dependant on the current state of the inputs. All outputs states depend only on the
current input states. This applies no matter how many inputs or outputs are present in
order to attain that function:

Logical Function
Input 1 Output 1
Input 2 Output 2
Input 3 Output 3

Input n Output n

14.2.3 Sequential Logic


In this case the state of the outputs of a system depends on the current state of the
inputs and also the past history of changes of the inputs. Thus sequential logic
involves memory as the logical system must note how the system has changed in the
past.
The Sequential Function Chart is an editor which enables you to define and control
sequences of actions for a process.
Sequences are used extensively in start-up and shutdown routine, batch control and
data flow control.

Chapter 14 - 4
System 800xA Training

14.3 SFC Editor


The SFC programming editor is divided into four panes, which are very similar to the
other language program editors. The main difference is the structure pane, used to
describe the sequential flow with steps and transitions.

It is not possible to have a sequence without any steps or transitions. The sequence
must consist of at least one step and one transition.

14.3.1 Sequential Rules


The sequence loop is always closed. The last transition is always connected to the first
step. The execution continues from the last step to the first step when the last
transition condition becomes true.

Chapter 14 - 5
T315C-14 Sequential Function Charts - RevE

14.3.2 Start the SFC Editor


Open the editor in the same way as learned in previous lessons and insert a new code
block:

Select “Sequential Function Chart ( SFC)” and type in a name for the new code block.

14.3.3 Structure Pane


All the graphical editing of the sequence structure is performed in the structure pane.
You will be able to add, delete, move and modify steps, transitions, actions,
simultaneous sequence, sequence selections, and jumps.
The basic editing principles are to first select an item and then choose a menu
command. All menu commands perform different actions depending on currently
selected item.

NOTE! To delete a step, you must select the step AND the
corresponding transition.

Chapter 14 - 6
System 800xA Training

14.3.4 SFC Toolbar


There is a special toolbar in the Sequence Function Chart editor, with shortcuts to
many of the commands found in the menu bar (or in the pop-up menus). You can see a
brief explanation of each button, if you hold the cursor over the button.

Toolbar Menu Command Description


button
Insert > Step, Transition Inserts a step and transition after the
current selection.
Insert > Sequence Selection Inserts a sequence selection after the
current selection.
Insert > Simultaneous Sequence Inserts a simultaneous sequence after
the current selection.
Insert > New Branch Inserts a new branch.

Insert > Jump Inserts a jump.

Tools > Make Subsequence Turn the selected steps and transitions
into a subsequence.
Tools > Dissolve Subsequence Dissolves the selected subsequence.

View > Step into Subsequence Steps into the selected subsequence.

View > Step Out of Subsequence Steps out of the open subsequence.

NOTE! Use the online help (F1) to read about these functions.

Chapter 14 - 7
T315C-14 Sequential Function Charts - RevE

14.3.5 Online Functions


In online mode, the code and the variable values are displayed in the program editor.
Online commands in the menu bar and toolbar buttons concerning the code are the
same as in the other language program editors.

There are functions only available in the online mode. Some of them are:

Toolbar Menu Command Description


button
Tools > Disable Actions Disables the associated actions of the
selected step (toggle command). No action
code executes when the step is active. All
actions associated to the step are blocked
(shut off).
Tools > Block Transition Blocks the selected transition (toggle
command). The transition condition is
regarded as False. When a transition is
blocked, the execution cannot continue in
the next step.
Tools > Force Forward Moves the execution, from the step before
the selected transition, to the step after the
selected transition, though the transition
condition is not evaluated. The execution
continues in the step after the selected
transition.
Tools > Force Backward Moves the execution, from the step after the
selected transition, to the step before the
selected transition, though the transition
condition is not evaluated. The execution
continues in the step before the selected
transition.
View > Step into Steps into the selected subsequence.
Subsequence
View > Step out of Steps out of the open subsequence.
Subsequence

NOTE! Use the online help (F1) to read about these functions.

Chapter 14 - 8
System 800xA Training

14.4 Steps and Transitions


The sequence element always has a step followed by a transition. This is the smallest
part of a sequence and is a complete entity. You may not have a step on its own or a
transition on its own, neither can you have two steps together or two transitions
together.

14.4.1 Initial Step


Each sequence has one (and only one) initial step.

The initial step becomes active at a cold start of the application(s) or when the
sequence is reset by the SequenceName.Reset variable.

14.4.2 Steps
A step is a basic element, which is activated by its preceding transition. The step
becomes active until its succeeding transition is true, and then next step is activated.

Each step has a name, that can be changed, and each step can have up to three
associated set of actions. It is not possible to change the action names.

The step is used to hold instructions which perform actions on the process devices.

NOTE! The instructions must be programmed in the Structured


Text language.

Double clicking on any step will result in that step being “opened” in the editor:

Chapter 14 - 9
T315C-14 Sequential Function Charts - RevE

Each of the boxes represents one code block (or tab) in a program editor, written in
Structured Text. There are three blocks called ‘Entry’, ‘Active’ and ‘Exit’.
• Instructions written in the Entry block (P1 = Pulse rising edge) are executed once
and once only on entry into the step. (During transition from the previous step)
• Instructions written in the Active block (N = Non-stored) are executed on each
scan whilst the step is active.
• Instructions written in the Exit block (P0 = Pulse falling edge) are executed once
and once only on exit from the step. (During transition to the next step).
NOTE! Any of the three may be used, left empty or even deleted.

14.4.2.1 Example – Usage of Code Blocks


The SFC step “Filling” must fill the tank until a level switch is reached, and then start
the agitator.
1. Filling_P1 : Input valves are opens, in the example V1 and V5

2. Filling_N : The level of the tank is monitored by a conditional sentence and when
the medium level switch is reached the motor is started

3. Filling_P0: The steps finalizes closing the inlet valves V1 and V5.

Chapter 14 - 10
System 800xA Training

14.4.3 Activate Outputs in Step Actions


When a step is active, the N code action of the step is active. If the statement in ST is
written in an N action, the code is executed once every cycle while the step is active.
The advantage of writing code in the actions of the step, is that all code associated
with this step is kept in one place.

Activated outputs in
the Draining_P1 step

Chapter 14 - 11
T315C-14 Sequential Function Charts - RevE

14.4.4 Activate Outputs in Separate Code Blocks


By using the StepName.x (bool) variable, it is possible to activate variables in other
code blocks. For example:
Start:= Draining.x;
This statement is written in another code block than the SFC sequence. It is easy to
find the reason for why the Start variable is true or false: it depends on whether the
step Draining is active or not.
Another more complex example:

Activated outputs in a
separate code block

The advantage for this is that all activation code associated with the entire sequence
could be collected in one code block, instead of being scattered among the actions for
all steps.

14.4.5 Transition
The transition from one step to the next holds a Boolean expression. (Note that it is
NOT a code block as such and requires a slightly different syntax).

A Boolean expression is any sequence of terms and operators that results in a single
Boolean result – True or False. The sequence will transit from one step to the next
when the transition following the currently active step goes true.

Chapter 14 - 12
System 800xA Training

14.4.6 Transit between Two Steps


During a transition, and during the exact scan that the transition occurs, the Active
block of the currently active step is executed, followed by its exit block, then the entry
block of the destination step executes and finally the active block:

Transit

When Tr12 goes true the actions are executed in the following order during that scan:
1. S11_N executes for one final time
2. S11_P0 executes once
3. S14_P1 executes once
4. S14_N becomes active

Chapter 14 - 13
T315C-14 Sequential Function Charts - RevE

14.5 Sequence Constructs


In principle there are two types of branch possible – the Simultaneous and the
Selection branch.

14.5.1 Simultaneous Sequences


The simultaneous sequence structure allows simultaneous and independent execution
of two or more branches of sequence actions. Each branch starts and ends with a step.
The last transition cannot activate its succeeding step unless the last step of both
branches is active.

When the transition Tr7 becomes true, Step S7 is left and each of the three steps S8, S9
and S10 become active.
When a parallel branch is left all preceding steps must be active AND the following
transition must become true. In the above steps S12, S9 and S13 must be active
together with Tr9 being true before the exit from the branch takes place.

Chapter 14 - 14
System 800xA Training

14.5.2 Sequence Selection


A series of transition conditions are monitored when the prior step is active. The next
step to become active is determined by which transition becomes true. That branch is
selected and the execution continues in that branch.
The execution can only continue in one of the branches. The branch with the highest
priority (graphically, the left to right branch order corresponds to the priority order)
and a true transition condition will be chosen.
NOTE! The leftmost branch has the highest priority.

If Tr15a becomes true then branching will occur to S16. However, if TR15b becomes
true then branching will occur to S17.
If both transitions become active at the same time, then the system will choose S16.

14.5.2.1 Change Priority


In some applications there are branches regarded as critical branches, with higher
priority than other branches.
If several branches in a sequence selection structure have a true transition condition at
the same time, it is possible to change priority in which order the branches will
execute.
The “Change Priority” command makes it possible to set the priority of a selected
branch in a Sequence Selection with several branches.
NOTE! The branch priority is only valid within each sequence
selection, and does not affect the execution at other
subsequences.

Chapter 14 - 15
T315C-14 Sequential Function Charts - RevE

In this example the branch Shutdown_Tank has the same priority as all other branches.

We change now the priority to “Highest”, since it is critical for our process. In case
several branches have a true transition condition at the same time, the branch
Shutdown_Tank will be executed.

The result is also visualized in the SFC editor.

NOTE! The execution order is from left to right that is why the
Shutdown_Tank is shown on the left side.

Chapter 14 - 16
System 800xA Training

14.5.3 Jumps and Destinations


Unstructured links inside the sequence structures are necessary in some cases to deal
with extraordinary situations and when, for example, changing the process production
mode.

A jump is a link from a named single transition to a named single step, located
anywhere in the same sequence structure. Multiple jumps can be connected to a step.
A jump can be considered as a sequence selection. It is a transition where the
execution is transferred from the preceding step to the jump destination step, when the
transition condition becomes true.
NOTE! It is not possible to jump between different sequences.

A forward jump is typically used when some sort of exception occurs. A backward
jump is typically used when a sequence loop is needed inside the overall sequence
loop.

Chapter 14 - 17
T315C-14 Sequential Function Charts - RevE

14.5.4 Subsequence
For documentation and overview reasons, it is sometimes convenient to graphically
structure the sequence into smaller parts, subsequences, thus hiding details until they
are requested. The subsequence is usually put around a sequence part, which performs
a set of logically related actions.
The subsequence function is a way to structure the sequence using a graphic hierarchy.
The sequence can be graphically structured into any number of hierarchical levels.

14.5.5 Advice on Good Programming Style


• Try to keep all SFCs as small as possible and focused on the overall behavior. It is
better to put detailed behavior in the action blocks or in other SFCs at a lower
hierarchical level.
• It is good practice to reduce the interaction between simultaneous sequences to a
minimum.
• Never allow step actions from different simultaneous sequences to change the
same variables.
• Avoid using constructs in which a divergent path branches out of a simultaneous
sequence since this may lead to a sequence that never completes or behaves
unpredictably.

Chapter 14 - 18
System 800xA Training

14.6 SFC Viewer


The "SFC (Sequential Function Chart) Viewer" is a tool in System 800xA that allows
the operator to display SFC structures with live data for active steps and transitions.

14.6.1 Activating the SFC Viewer


The SFC Viewer aspect is only available if activated using Control Builder. This can
be done by selecting “Tools > SFC Viewer Aspect” on the SFC code block.

NOTE! There will be a separate aspect for each code block.

Chapter 14 - 19
T315C-14 Sequential Function Charts - RevE

14.6.2 Updating the SFC Viewer Aspect


The SFC Viewer aspect content in the Engineering Workplace refers to the SFC code
in Control Builder M, but it’s not synchronized (updated automatically).
In case the SFC code has been changed in Control Builder M, you need to updated the
SFC Viewer aspect content manually:
1. Uncheck the menu item ”SFC Viewer Aspect” in SFC editor:

2. Then press the ”Save” button in the POU editor.

3. Check again the menu item ”SFC Viewer Aspect” in SFC editor:

4. Then press the ”Save” button in the POU editor. Thus the SFC Viewer aspect is
created again and the contents is updated.

F Exercise 14.1

Chapter 14 - 20
System 800xA Training

14.7 Sequence Control Variables


There are facilities to control a sequence and monitor the timing of sequence steps.
When these functions are used, automatically generated variables are available for use
in the code.

14.7.1 Automatically Generated Variables


For one sequence, the following variables are automatically generated when the
program is compiled.

Name Type Menu Description


Access*
SequenceName.Reset Bool Yes The sequence is reset to the initial
step. The system resets this variable
automatically to False after one scan.
SequenceName.Hold Bool Yes All transitions in the sequence are
blocked. The Reset function as above
is NOT affected.
SequenceName.DisableActions Bool Yes All actions associated to the steps of
the sequence are disabled, that is they
will not execute.
StepName.X Bool No This variable is True while the step is
active.

• SequenceName = code block name of the sequence


• StepName = step name
NOTE! * A Yes in the Menu Access column means that the
variable can be enabled in the online mode.

The same actions are also available in on-line mode through the menu.

Chapter 14 - 21
T315C-14 Sequential Function Charts - RevE

14.7.2 Step Timing Variables


The following variables are only generated if the Step Elapsed Time command in the
Tools menu is enabled, before the program is compiled.

Step time supervision activates an alarm if any step is active for more than a specific
time.

Name Type Description


SequenceName.MaxStepTime* Time Defines the maximum allowed time for step time
supervision.
SequenceName.Check Bool The step time supervision can be
activated/deactivated in the code, instead of
putting a check mark in the Tools menu.
SequenceName.StepTimedOut* Bool Becomes true if one step has exceeded the
maximum time for step time supervision (see
SequenceName.Max.StepTime above). Only
enabled if SequenceName.Check is True.
StepName.T Time Gives the activation time of the step (in
milliseconds). It is reset when the step is
activated, and then increased until the step is
deactivated. It keeps its value until the next
activation.

* The SequenceName.MaxStepTime and SequenceName.StepTimedOut variables are


available (visible) in the insert variable dialog, even if the Step Elapsed Time
command not is enabled. They have, however, no use, if not Step Elapsed Time
command is enabled.
• SequenceName = code block name of the sequence
• StepName = step name

Chapter 14 - 22
System 800xA Training

14.8 Two Direction Sequence Chain


The Two Direction Sequence Chain is available for the control of start-up and
shutdown procedure for continuous or intermittent processes. It expands the “normal”
SFC with a set of predefined types which are located in the SeqStartLib library.
The Two Direction Sequence Chain contains, additional to IEC 61131-3 standard SFC
specification, following functionality:
• Operator modes
• Manual, Automatic and Priority commands
• Interlocks
• Priority command alarms
• Stable End-positions with monitoring
• Runtime monitoring per SFC step (Step max time)
• Directly change-over from start-up (On sequence) to shutdown (Off sequence) and
vice versa
NOTE! You can find some more information in the on-line help
of the Control Builder.

14.8.1 “SFC Header” Type


The SFCHeader function block type contains the basic functionality to control and
supervise the SFC.

SFC Header

Variables

Chapter 14 - 23
T315C-14 Sequential Function Charts - RevE

It has the operating modes Automatic and Manual. The Manual mode has higher
priority and is the default startup mode.

In Manual mode following operator commands are accepted:


• Start On sequence (or continue from stopped) via InteractionPar.ManOn
• Start Off sequence (or continue from stopped) via InteractionPar.ManOff
• Stop sequence via InteractionPar.ManStop
• Reset sequence via InteractionPar.ManRes

In Automatic mode following automatic commands are accepted:


• Start On sequence (or continue from stopped) via AutoOn
• Start Off sequence (or continue from stopped) via AutoOff
• Stop sequence via AutoStop
• Reset sequence via AutoRes

14.8.2 “SFC Step” Type


The SFCStep function block type contains additional SFC functions for processing in
the SFC structure and for display values (step number, step min and max time) in the
faceplate.
The SFCStep function block calculates the output when the X input is true and
initializes the output when X is false. It is important that each step of the SFC has to
call this function block.

Chapter 14 - 24
System 800xA Training

14.8.3 Predefined Template


The control module type SFC2DSeqChainExample contains the SFCHeader
functionality with a SFC structure example and predefined alarms and events.

NOTE! You can copy the control module type


SFC2DSeqChainExample to start with.

OFF sequence ON sequence

Chapter 14 - 25
T315C-14 Sequential Function Charts - RevE

14.8.4 Operator Faceplate


The SFCHeader function block contains also an operator faceplate:

Manual/Auto
Mode

Starts OFF Starts ON sequence


sequence

Stop sequence

Chapter 14 - 26

You might also like