ICT role in 21st century education and its challenges
10 basics automatic mode control v1.00_en
1. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 1
Content 10
10 Basics Automatic Mode Control ............................................................................3
10.1 Learning targets..................................................................................................................... 3
10.2 Setting the Auto/Manual mode by program........................................................................... 4
10.2.1 Logic for control output (open/close command to valve)....................................................... 4
10.2.2 Demonstration with push buttons and switches .................................................................... 5
10.2.3 Examples for controlling the Auto / Manual mode by program.............................................. 5
10.3 Task and checkpoint.............................................................................................................. 6
10.4 Sequential control with SFC .................................................................................................. 7
10.4.1 SFC Charts ............................................................................................................................ 7
10.4.2 Elements of a Sequence........................................................................................................ 9
10.4.3 Close cooperation................................................................................................................ 10
10.4.4 Interconnections between CFC and SFC............................................................................ 11
10.4.5 Initialization, Processing and Termination........................................................................... 14
10.4.6 Example............................................................................................................................... 15
10.4.7 SFC in test mode ................................................................................................................. 15
10.4.8 Task and checkpoint............................................................................................................ 16
10.4.9 Operating state logic for sequencers (sequencer OSL) ...................................................... 16
10.4.10 Operating state logic for a SFC (SFC OSL) ........................................................................ 17
10.4.11 External View....................................................................................................................... 18
10.4.12 Task and Checkpoint........................................................................................................... 18
10.4.13 Add a new sequencer into the chart and setup the properties............................................ 19
10.4.14 Default behavior of an SFC ................................................................................................. 19
10.4.15 Sequencers reacting on changes of state ........................................................................... 21
10.5 Sequences on the OS.......................................................................................................... 22
10.5.1 Preparation in the ES........................................................................................................... 22
10.5.2 Steps of SFC operation in Runtime ..................................................................................... 23
10.5.3 SFC MultiChart Control........................................................................................................ 24
10.6 SFC type.............................................................................................................................. 27
10.7 Task and checkpoint............................................................................................................ 28
2. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 2 Training Documentation, V1.00, ST-PCS7SYS
3. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 3
10 Basics Automatic Mode Control
10.1 Learning targets
The participant will learn about
• the general concept of automatic
mode control
The participant will be able to
• have devices controlled
dependend of states of other
devices
• have devices controlled by
sequential controls
4. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 4 Training Documentation, V1.00, ST-PCS7SYS
10.2 Setting the Auto/Manual mode by program
10.2.1 Logic for control output (open/close command to valve)
The diagrams below show the logic of a VlvL block regarding the control signal Ctrl
and the Auto / Manual mode.
In these simplified diagrams the influence of other signals like Local mode, Out of
Service, forcing, interlocks and feedback error are ignored.
The red arrows represents the Boolean value “true” (digital: 1) that is send from the OS,
by clicking the related button (with OK) to the related input of the block in the AS.
After processing this value by the block program, the input value is put back to “false”
(digital: 0).
CtrL
VlvL
Logic for
Auto / Manual
mode
OpenAut
OpenMan
CloseAut
CloseMan
S
R
1
Feature.Bit4:
0 = Button mode
1 = Switch mode
Output driver
PIQ
Output module
Simplified diagram for explaining the logic
Logic for Auto / Manual mode
ModLiOp
AutModLi
AutModOp
ManModLi
ManModOp
S
R
1
Feature.Bit4:
0 = Button mode
1 = Switch mode
Simplified diagram for explaining the logic
5. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 5
10.2.2 Demonstration with push buttons and switches
Below 2 VlvL blocks of R310 with connections to signals from the Signal Box:
VlvL
OpenAut
CloseAut
Button mode
ModLiOp
AutModLi
ManModLi
V311
T4
S1
T3
T2
T1
VlvL
OpenAut
CloseAut
Switch mode
ModLiOp
AutModLi
ManModLi
V312
S2
S4
S3
T = push button
S = Switch
10.2.3 Examples for controlling the Auto / Manual mode by program
ModLiOp
AutModLi
0
1
ModLiOp
AutModLi
ModLiOp
AutModLi
0
1
0
1
t
ModLiOp
AutModLi
2
3
4
5 6 7
1
8
1. The gray rectangles represent any block offering one or two outputs that can be
used to control the mode.
2. When ModLiOp has value 0, then the mode can only be controlled by operator on
the OS.
3. The mode is controlled by the source of the connection
4. When the source changed from 0 to 1: Auto mode, operator can not change to
Manual.
When the source changed from 1 to 0: remains in Auto mode, but operator can
change to Manual.
5. Operator controls the mode.
6. Auto mode, can not change to Manual
7. Switching back to Manual mode, operator can not change to Auto.
8. Operator controls the mode.
6. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 6 Training Documentation, V1.00, ST-PCS7SYS
10.3 Task and checkpoint
Task: Auto mode for the material tanks
Goal
One common switch on the OS to set the outlet valves and outlet pumps of the material
tanks in Auto mode.
When in Auto Mode, then the outlet valve and outlet pump of a material tank must follow
up the demand for the material: opening and starting when a dose valve has opened.
Checkpoint
Consider …
• a way to have the Auto mode of all
devices of D210 and R310 set by a
single operation, leaving the
devices in such a state, that the
operator can switch back to
Manual mode if required.
7. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 7
10.4 Sequential control with SFC
The sequential function chart (SFC) is a sequential control system executed in stages
which, depending on certain conditions, advances from one state to the next.
A sequential control system controls functions, such as CFC charts, via mode and state
changes, and processes them selectively.
SIMATIC Manager
STEP 7
STEP 7 - tools
PH IEAPO
CFC SFC
WinCC
SFC Visualization
AS OS
ES
10.4.1 SFC Charts
Configuration limits of the SFC
• Sequencers per SFC chart ≤ 8
• Steps per sequencer 2 - 255
• Instructions per action ≤ 50
• Transitions per sequencer 1 - 255
• Conditions per transition / start
condition ≤ 16
A SFC chart consists in maximum 8 sequencers for different states of the sequential
control system (e.g. default: Run, Hold, Resume, Abort...or customized: Heating,
Cooling, Dosing, Draining, etc.). An SFC chart is assigned uniquely to a CPU and is
also executed completely on this CPU.
See [103] PCS 7 V8.0 Engineering System - 12_2011, 8.12.8 for more detail
8. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 8 Training Documentation, V1.00, ST-PCS7SYS
Run Sequence
The runtime properties of an SFC chart or SFC instance determine how the SFC is
included in the chronological execution sequence within the overall structure in the
CPU. These properties determine the behavior of the target system with respect to
response times, dead times, or the stability of time-dependent structures, such as
control loops.
The insertion in the Run Sequence is done using the Predecessor for Insert Position.
The SFC chart is represented by a single object like a chart or as a part of a runtime
group like a block:
Single object
like a chart
Part of a
runtime group
like a block
It depends on the structure of your project!
Insufficient runtime properties of an SFC chart are a typical beginner’s mistake
caused by a wrong default position „Predecessor for Insert“.
The cyclic operation interval of blocks controlled by an SFC must not be larger than
the cyclic operation interval of the SFC itself.
9. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 9
10.4.2 Elements of a Sequence
A newly created sequencer (menu command Insert > Sequencer > ...) is inserted at a
selected position in the SFC in its initial state consisting of an initial step, transition and
final step.
In its initial state, the new SFC consists of one sequencer. You create each sequencer
in its own working window.
A tab is created for every working window at the bottom of the screen. The tab shows
the name of the sequencer (for example, RUN or SEQ1). You can switch to the
individual sequencers using these tabs.
A toolbar “Element bar” offers the elements to build up a sequence.
Tabs represent
sequencers
Element bar
Step
Transition
Step
Transition
Step
Transition
Loop
backwards
Step and Transition
Parallel
branch
Alternative
branch
Jump
Lower
branch line
Upper
branch line
See [304] SFC for SIMATIC S7 - Programming and Operating Manual - 12_2011,
11.2 for more details about the sequencer topology.
10. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 10 Training Documentation, V1.00, ST-PCS7SYS
10.4.3 Close cooperation
There is a close cooperation between SFC and CFC:
• Sequences will not have access to the process signals by their own.
• Every access is to be configured in relation to existing function in CFC charts.
Controlling
Controlling devices in the process is to be done through the control blocks in CFC.
In general the Auto mode and its related input to control is being used.
For a VALVE block the input to be used is AUTO_OC. The VALVE block will have the
actual connection to the process through the output driver.
Monitoring
Monitoring the process (in general as a feedback from an earlier step) is done through a
block for monitoring the value, using a connection to the related input driver.
SFC CFC
Open command
in Auto mode
Valve is
closed
Process value of
level monitoring
Move
In CFC, an SFC access can be moved using ALT-drag.
11. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 11
10.4.4 Interconnections between CFC and SFC
Interconnection to APL blocks in a Transition
2
1
4
3
5
1. Open the Transition properties (Double click). There is a (possibly empty) list of
conditions arranged in boxes.
Each line represents a condition. A maximum of 16 conditions per transition are
possible. They are logically linked (default logic: AND).
Each condition consists of a left address, an operator (that you can select from a list
box), and a right address.
By clicking the "Go To" button, you can jump to the point of use of the address in
whose edit box the text cursor is located (for example, to the CFC chart with the block
I/O that is the address of this statement.
2. The "Browse..." button opens a dialog box where you can select an address for the
edit box of the condition where the text cursor is located.
3. Navigate to the required block to get the corresponding I/Os displayed.
4. Select the desired block I/O.
5. In case of APL blocks with structures as I/O data type, it is necessary to open the
structure. Only a single structure element can be linked. An additional dialog offers
you the structure element to be selected.
12. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 12 Training Documentation, V1.00, ST-PCS7SYS
Interconnection to APL blocks in a Step
2
4
3
5
1
1. Open the Step properties (Double click). There is a (possibly empty) list of
commands arranged in boxes.
Each line represents one statement. You can make up to 50 statements.
Each statement line consists of the following elements:
− The button with the line number for selecting the line
− The radio button that you can use to select the statement as an OS comment
− An edit box for the left address, the operator, and the edit box for the right
address
If the text cursor is located in an address box, the shortcut menu displays only the
functions needed for editing the contents.
2. The "Browse..." button opens a dialog box where you can select an address for the
edit box of the statement where the text cursor is located.
3. Navigate to the required block to get the corresponding I/Os displayed.
4. Select the desired block I/O.
5. In case of APL blocks with structures as I/O data type, it is necessary to open the
structure. Only a single structure element can be linked. An additional dialog offers
you the structure element to be selected.
Accesses to CFC blocks can also be modified in the relevant CFC chart. This
modification, however, is restricted to "rewiring" SFC accesses; in other words,
moving the access to another block I/O (with <Alt> + Drag-and-Drop).
Do not write any values to outputs of blocks and charts (CFC and SFC). Generally,
these are overwritten again by the processing of the block or chart.
13. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 13
Options for to editing addresses in a step
• Drag the block inputs/outputs from CFC charts directly to the address box. Resize
and arrange the windows of CFC / SFC charts for this purpose.
• In the addresses, you can enter accesses to CFC block inputs/outputs whose block
does not yet really exist in the CFC chart. These statements are displayed in the
statement line on a yellow background and are set up as textual interconnections.
• Regardless of the selection and application of changes, all completed lines can be
copied and reinserted in any type of actions of other steps at another line.
Drag&Drop
Textual
reference
Line buttons with
context menu
Statement as an
OS comment
Filtering the I/Os in the Browse Dialog
Double click
to sort
Enter a text to
identify
14. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 14 Training Documentation, V1.00, ST-PCS7SYS
10.4.5 Initialization, Processing and Termination
In the properties of a step, there are 3 sections where you can enter the
actions/commands:
Initialization
If actions have been configured here, they will be executed only once: at transition from
the previous step to this step.
Processing
If actions have been configured here, they will be executed during every program
cycle, as long as the condition for transferring to the next step is not completed.
Termination
If actions have been configured here, they will be executed only once: at the transition
from this step to the next one.
Step active
Start Trans 2
Stop Trans 2
cycle
Transition fulfilled
See [304] SFC for SIMATIC S7 - Programming and Operating Manual - 12_2011,
15.3.6.2 for more details
15. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 15
10.4.6 Example
Next diagram can be used for a demonstration in configuring a SFC chart:
START
L33
SP=70
H67
SP=50
L53
SP=30
L32
END
70
50
30
SP_EXT
PV_IN
t
Step enabling condition:
Process value PV_IN less than 33?
Step enabling condition:
Process value PV_IN greater than 67?
Action:
Set setpoint SP_EXT to 70
• Linear sequence
• Conditions in transitions
• Actions in steps
• Test
Start step
10.4.7 SFC in test mode
In SFC test mode a operating/status bar is displayed for monitoring and controlling. The
various step control modes change the behavior of the SFC when passing control from
active steps to successor steps:
Control
mode
Operating
state
T
T or C
T and C
C
T/T and C
Transition
Transition or Confirmation by User
Transition and Confirmation by User
Confirmation by User
Step specific Control by operator
Operator
confirmation
button
Selection of
the step
control mode
Step Control Modes
Operator
commands
16. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 16 Training Documentation, V1.00, ST-PCS7SYS
10.4.8 Task and checkpoint
Task: First sequence for R310
Goal
A first short sequence for dosing one material and to learn proper switching between
manual and automatic mode.
Checkpoint
What has to be changed in the
sequence …
• if the valve would be in button mode
instead switch mode (Feature bit.4)?
10.4.9 Operating state logic for sequencers (sequencer OSL)
The operating state logic of the sequencer is defined by the diagram of the state
changes.
States exited due to
commands
Operator commands
Implicit state changes
triggered by SFC
See [304] SFC for SIMATIC S7 - Programming and Operating Manual - 12_2011,
15.2.5.5 for more details
17. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 17
10.4.10 Operating state logic for a SFC (SFC OSL)
Diagram of state changes
The diagram below shows the changes of states of a SFC.
Diagram of state changes
States that are exited
through events
Transition states that are
implicitly exited
States applied from OSL
for SFC V5.x
Events: Commands / Conditions /
External Signals / Internal Signals
Event: Error
Results applied from OSL
for SFC V5.x
Implicit transitions that are
triggered from SFC, if the active
sequencer has been processed to
completion or if there is not
sequencer to process.
The sequencer OSL is executed independent of the SFC-OSL when a sequencer is
processed. This means that the sequencer has a state which differs from the SFC state.
For example, the state of the SFC OSL can be "Holding", whereas the state of the
sequencer OSL is "Run" (due to the processing of the sequencer to the "Holding" state).
The processing of the sequencer OSL is subordinate to the SFC OSL. This means that
the state change in the SFC OSL usually effects the state change in the sequencer
OSL.
18. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 18 Training Documentation, V1.00, ST-PCS7SYS
10.4.11 External View
Commands
and operating
states
Provide
information
about states
and modes to
other blocks
Execution
options
Operating
modes
Every SFC has an external view that is displayed by the CFC editor.
• On the left parameters for controlling the states, modes and more by SFC steps and
connections to blocks in CFC charts.
• On the right parameters representing states, modes and more information to be used
in SFC transitions and for connections to blocks in CFC charts.
• The inputs need different types of values / static or dynamic (edges).
See [304] SFC for SIMATIC S7 - Programming and Operating Manual - 12_2011,
12.3.1 for more details
10.4.12 Task and Checkpoint
Task: Complete sequence for R310
Goal
A sequence for dosing and heating a mixture of the 3 materials
Checkpoint
What happens …
• during a dosing step, when the
command Hold is executed?
19. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 19
10.4.13 Add a new sequencer into the chart and setup the properties
Insert a new
sequencer at the
corresponding
position
Define the start conditions
basing on the SFC OSL
Assign a priority for
the case that several
sequencers fulfill their
start condition at the
same time
10.4.14 Default behavior of an SFC
By default a SFC contains a single sequencer with the default name RUN.
Start
The state RUN is the start
condition for the sequencer
called RUN.
• When the SFC is started (button Start) for the first time, the first state change will be
from IDLE to STARTING.
• When the RUN sequencer is the only one, nothing will react on the state STARTING,
so the next program cycle the state will change from STARTING to RUN.
20. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 20 Training Documentation, V1.00, ST-PCS7SYS
Hold
When during the execution of the RUN sequencer, the SFC is held (button Hold), the
state change will be from RUN to HOLDING.
When the RUN sequencer is the only one, nothing will react on the state HOLDING, so
the next program cycle the state will change from HOLDING to HELD.
21. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 21
10.4.15 Sequencers reacting on changes of state
The following picture illustrates the relationship between sequences and operating
states.
Sequencer RUN
Start condition RUN
Sequencer Holding
Start condition Holding
Sequencer RUN
Start condition RUN
Sequencer Resuming
Start condit. Resuming
22. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 22 Training Documentation, V1.00, ST-PCS7SYS
10.5 Sequences on the OS
10.5.1 Preparation in the ES
Block icons for SFCs are generated automatically during OS compilation always.
As an additional option to the OS you can use SFC Visualization.
It allows you to monitor and control SFCs on the OS in a very similar way as in SFC
editors test mode.
Block icon
for SFC
OS compilation
Create / update block icon mechanism
Compilation
At OS compilation, have the proper check box set, which will allow you to have all the
relevant information transferred to the OS, including the creation of the pictures:
Block icons
In a similar way to OS relevant blocks in CFC, there can be representatives of SFC
charts being installed in pictures.
User defined buttons
In Graphics designer: Use a Dynamic Wizard to link a button with an SFC visualization
object.
User-defined
button
23. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 23
10.5.2 Steps of SFC operation in Runtime
Predefined button
in the 2nd key set
User-defined
button
User-defined
button
Block icon
Section
Overview
Faceplate
SFC browser
Separate
windows
Sequencer properties
and start condition in
runtime
24. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 24 Training Documentation, V1.00, ST-PCS7SYS
10.5.3 SFC MultiChart Control
A SFC MultiChart Control allows you to:
• overview several sequences in one picture
• browse to the Section and Overview window of a SFC
• operate a SFC using buttons on the control
Configuration in Graphics Designer
1
2
3
4
1. In the Object Palette, click the „Standard" tab.
Select the object “Control“ in the list.
2. Place the mouse pointer at the position in the picture where you want to insert the
control. The mouse pointer changes into a crosshair with an object symbol
attached.
3. Drag the control to the desired size with the mouse.
4. A list offering all registered ActiveX controls is opened.
Select the entry “PCS 7 SFC Multichart Control“.
The insertion process for the selected control is finished.
If you do not stretch the frame to its complete size, not all the columns will be visible.
In this case, a horizontal scroll bar is inserted to enable you to scroll through the
contents in the visible area during runtime mode.
25. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 25
Double click
Open the
SFC browser
5
6
7
8
5. Double-click the SFC MultiChart Control. The "Properties" dialog box opens.
6. Open the "General" tab and assign the desired SFCs to the control or delete them
from it.
7. Open the SFC browser.
8. Select the desired SFC and then close the dialog box with "OK". Repeat this
procedure for every SFC that you want to include in the SFC MultiChart Control. A
row is inserted for each SFC. This row includes the columns that provide SFC
information in runtime mode.
In the Runtime Window
Access to the
selected SFC
Direct jump to
the step in
the faceplate
Boxes for mode
controlling
Operating the
selected SFC
26. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 26 Training Documentation, V1.00, ST-PCS7SYS
SFC aborted
Waiting for Reset
or Start command.
See [305] SFC Visualization - Programming and Operating Manual - 12_2011, 5.13
for more details
27. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
Training Documentation, V1.00, ST-PCS7SYS 10 - 27
10.6 SFC type
The SFC chart is able to use direct access to addresses in CFC (block I/O).
SFC charts can be edited independently of each other.
SFC CFC
A SFC type is created beforehand in a chart folder (in library or directly related to AS
system).
Steps and transitions will have access to the SFC type its own interface.
Instances
An SFC instance is derived from an SFC type and initially has properties identical to
those of the SFC type. You have an executable sequential control system only after
interconnecting the SFC instance with blocks and signals of basic automation in CFC
charts.
SFC type SFC instance placed into a CFC chart
By default, the interface of a SFC type is the same as the SFC external view, extended
by a number of SFC type specific parameters. Additionally, the user can configure more
parameters to create the application specific interface (characteristics).
BATCH
SFC types can be configured to represent an Equipment Phase in a SIMATIC BATCH
application.
See [304] SFC for SIMATIC S7 - Programming and Operating Manual - 12_2011,
4.5.2 for more details
28. PCS 7 System Course
SIMATIC PCS 7 – Basic Automatic Mode Control
10 - 28 Training Documentation, V1.00, ST-PCS7SYS
10.7 Task and checkpoint
Task: Holding and resuming
Goal
Preventing material flow when the sequence is held
Checkpoint
What else…
• … could be done in probably more
sequencers to this SFC?
Task SFC Objects
Goal
Have additional ways to monitor and control the progress of the sequence changes of
state