You are on page 1of 85

How do you program the

SIMATIC S7 in compliance
with the IEC 61131-3
standard?
Unrestricted © Siemens 2020 siemens.com/controller

Unrestricted © Siemens 2020


S7 Programming language

1 Overview S7 Programming language


2

2 SIMATIC Programming with S7-SCL


3

4
3 SIMATIC Programming with S7-Graph

5
4 Hand-on experience

5
6
5 Q&A
6

Unrestricted © Siemens 2020


Page 2 8/12/2020
S7 Programming language

1 Overview S7 Programming language


2

2 SIMATIC Programming with S7-SCL


3

4
3 SIMATIC Programming with S7-Graph

5
4 Hand-on experience

5
6
5 Q&A
6

Unrestricted © Siemens 2020


Page 3 8/12/2020
Overview S7 Programming language

Programming language TIA Portal S7 IEC 61131-3

Ladder Diagram LAD LD

Function Block Diagram FBD FBD

Structured Text SCL ST

Instruction List STL IL

Sequential Function Chart S7-GRAPH SFC

Unrestricted © Siemens 2020


S7 Programming language

1 Overview S7 Programming language


2

2 SIMATIC Programming with S7-SCL


3

4
3 SIMATIC Programming with S7-Graph

5
4 Hand-on experience

5
6
5 Q&A
6

Unrestricted © Siemens 2020


Page 5 8/12/2020
TIA Portal

S7-SCL: Structured Control Language


Programming

Unrestricted / © Siemens VN 2020


S7 - SCL

What is S7 – SCL ?
1

1.1
2

1.2 Language description


3

4
1.3 Compile and test

5
1.4 Source code generation
6

Unrestricted © Siemens 2020


Page 7 8/12/2020
S7 - SCL

What is S7 – SCL ?
1

1.1
2

1.2 Language description


3

4
1.3 Compile and test

5
1.4 Source code generation
6

Unrestricted © Siemens 2020


Page 8 8/12/2020
SCL in STEP 7
What is SCL ?

SCL := high-level language programming + extensions typical for PLCs ;

▪ Structured Control Language as text-based

▪ Corresponds to IEC 61131-3 (ST)

▪ Certified according to PLCopen WinAC


S7-300 S7-1500
▪ Complex calculations & algorithms S7-1200
S7-400
▪ Data operations, e.g. sort data

▪ Program code exchangeable between S7-1200, S7-300, S7-400


and WinAC

Unrestricted © Siemens 2020


SCL in STEP 7
Usage of SCL: IF data_operation THEN SCL

Example: Storage of Real-values in an array

3630.0 3630.0
5290.0 5290.0
6383.0 6383.0
9215.0 9215.0
13195.0 13195.0

Unrestricted © Siemens 2020


SCL in STEP 7
Usage of SCL: IF data_operation THEN SCL

Code in LAD for S7-1200 Code in STL for Solution in SCL for
S7-300/400 S7-300/400
S7-1200 AND S7-1200/1500
WinAC
S7-300
S7-1500
S7-400 S7-1200 WinAC
S7-300

S7-400

Unrestricted © Siemens 2020


SIMATIC STEP 7 in TIA Portal – Language Innovations
Efficient high level programming

High level programming with SCL

• Modern, text based SCL-Editor with highlighting, auto-


completion, support for passing parameters to a function
call,…

• Optimized for more complex algorithms and data


manipulations

• Access to the command set of the SIMATIC Controllers

• Exchange of ASCII sources by In-/Export

Unrestricted © Siemens 2020


S7 - SCL

What is S7 – SCL ?
1

1.1
2

1.2 Language description


3

4
1.3 Compile and test

5
1.4 Source code generation
6

Unrestricted © Siemens 2020


Page 13 8/12/2020
SCL in STEP 7
Operators

result := expression ;
Example: switch_on := manual_on OR auto_on;
All assignments, control operations and calls are ended by ;
Combination Description Operator
Assignment Assignment :=
Parenthesis (Statement) (,)
Binary logic Negation NOT
AND AND, &
OR OR
Exclusive-OR XOR
Comparison Less than, less than or equal to, greater than, greater than or <, <=, >, >=,
equal to, equal, not equal to =, <>
Arithmetic Plus, minus (sign) +,-
Addition, Subtraction +,-
Multiplication, Division *, /, DIV,
Exponentiation MOD
**
Unrestricted © Siemens 2020
SCL in STEP 7
Direct addressing (Example)

Direct Addressing : symbolic and absolute!

Area Notation example Examples

Bit %DBz.DBXy.x, %Ex,y %DB1.DBX0.0, %E0.0

Byte %DBz.DBBy, %ABy %DB5.DBB2 , %MB2


Absolut addressing
Word %DBz.DBWy, %MWy %DB5.DBW4, %MW3

Dword %DBz.DBDy %DB5.DBD8

Symbolic
„<DB-Symbol>“.<Variable-Name> „Motor“.Sollwert
addressing

Unrestricted © Siemens 2020


SCL in STEP 7
Direct addressing (Example)

In the SCL-Editor, inputs, outputs and Bit memory are always Symbolic

: Tags symbols and addresses in table form

Unrestricted © Siemens 2020


SCL in STEP 7
Indirect addressing

Indirect addressing, with symbolic address access of Arrays

Syntax: „<DB-Symbol>“.<Array-Symbol> [Index]

Example:

Unrestricted © Siemens 2020


SCL in STEP 7
Overview: Functions for Data handling

S7-1200
Controler S7-300
WinAC
S7-1500
S7-400

Possibilities ▪ ANY – Pointer ▪ VARIANT ▪ ANY - Pointer und VARIANT


▪ Absolute und symbolic ▪ Symbolic Addressing ▪ Symbolic Addressing
Addressing

System functions BLKMOV FILL MOVE_BLK FILL_BLK BLKMOV FILL

PEEK POKE MOVE_BLK FILL_BLK

PEEK POKE

Unrestricted © Siemens 2020


SCL in STEP 7
New Functions: Rising and falling edge

When a Rising edge is detected on the input CLK , the output Q returns signal status 1

Rising edge: Example

R_TRIG CLK

Local Q

When a falling edge is detected on the input CLK , the output Q returns signal status 1

Falling edge Example

F_TRIG CLK

Local Q

Unrestricted © Siemens 2020


SCL in STEP 7
Control operations – Overview

Control operations can be programmed easily using the code snippet!

Keyword Functionality

Program branching IF Program branching with Boolean Value

CASE Program branching with INT Value

Program loop FOR Program loop with run variable


(Abort possible)
WHILE Program loop with execution condition

REPEAT Program loop with abort condition

Loop aborts CONTINUE Abort current loop pass

EXIT Exit program loop

Block abort RETURN Exit the block

Unrestricted © Siemens 2020


SCL in STEP 7
Program Branching - Syntax

IF Instruction Example of use

IF Condition_1 THEN
Statements_1;
ELSIF CONDITION_2 THEN STL
Statements_2;
ELSE
Last_Statements;
END_IF;
SCL

Unrestricted © Siemens 2020


SCL in STEP 7
Program Branching - Syntax

Example of use
CASE- Instruction:
STL
CASE Selection_Variable OF

CONST_1: Statements;
…..
CONST_n: Statements;
…..
SCL
ELSE
Statements;
END_CASE;

Selection_Variable has data type


INT

Unrestricted © Siemens 2020


SCL in STEP 7
Program loops- Syntax

FOR Loop
START_VAR, END_VAR
For START_VAR TO END_VAR BY STEP_WIDTH DO und
Statements; STEP_WIDTH can have
END_FOR; either Data type INT or
DINT

WHILE Loop REPEAT Loop

REPEAT
WHILE Condition DO Statements;
Statements; Condition has data type
UNTIL Condition; BOOL
END_WHILE; END_REPEAT;

For a better performance, Loop index should be from a 32 Bits data type.

Unrestricted © Siemens 2020


SCL in STEP 7
Program loops- Syntax
Example of use

STL SCL

SCL

Symbolic Programming possible

Unrestricted © Siemens 2020


SCL in STEP 7
Loops abort- Syntax

CONTINUE Instruction:
For i:= 0 TO 10 DO
After Continue, the control variable is
IF #Request THEN Continue;
incremented by the specified increment
END_IF;
immediately.
Buffer[#i] := #Value+#i;
END_FOR;

EXIT Instruction:
For i:= 0 TO 10 DO
Buffer[#i] := #Value+#i; Execution of the program is continued after the
IF #Error THEN EXIT; end of the loop (FOR Loop).
END_IF;
Further Statements…
END_FOR;

Unrestricted © Siemens 2020


SCL in STEP 7
Loops abort- Syntax

GOTO Instruction(Example):
IF #Error THEN
GOTO MARKE ; GOTO causes an immediate jump to the specified
END_IF; label and therefore to a different statement within
Further Statements the same block.
MARKE:
#Status := W#16#8081;

RETURN Instruction (Example):

IF #Done THEN
RETURN exits the currently active block (OB, FB,
RETURN;
FC) and returns to the calling block
END_IF;
Further Statements

Unrestricted © Siemens 2020


SCL in STEP 7
Block call

Input parameters are with := and output parameters with => typified.

STL SCL
FC without Return value

FC
FC with return value

Unrestricted © Siemens 2020


SCL in STEP 7
Block call

Input parameters are with := and output parameters with => typified.

STL SCL
Calling FB as a single instance

FB Calling FB as a multi-instance

Unrestricted © Siemens 2020


S7 - SCL

What is S7 – SCL ?
1

1.1
2

1.2 Language description


3

4
1.3 Compile and test

5
1.4 Source code generation
6

Unrestricted © Siemens 2020


Page 29 8/12/2020
Compile and test
Online view for blocks

Online – offline compare directly in the project tree


▪ Online connection to the PLC with
a single click
▪ Direct display of the operating mode
and diagnostic overview directly in Operating mode of the CPU
the project tree
Diagnostic information
▪ Online – offline compare of blocks
directly in the project tree
Offline = online block

Block exists only offline

Offline ≠ online block

Block exists only online

Unrestricted © Siemens 2020


Compile and test
Testing SCL blocks S7-1500 S7-1200 S7-300/400/WinAC

Monitor column can be adjusted in width


Settings des Editors (S7-SCL V5.3)
and position
In case the loop is not executed:
Values have grey appearance

Collapsed: only result is shown

Expanded: all operands of a line are


visible

Clicking a line shows an additional


window with all referred operands

Unrestricted © Siemens 2020


Compile and test
Watch table

Functions:
▪ Created in the folder
„Watch tables“
▪ Adding tags via Drag & Drop from:
▪ Data blocks Show / hide modify columns
▪ Tag tables
Modify tags
▪ Program blocks
Monitor all

Activate modify value

Unrestricted © Siemens 2020


Compile and test
Breakpoints

Current Position 3

3. Activate breakpoints
1. Set breakpoint with double click or Only online possible/ Test modus will be automatically
right mouse click activated

S7-1500 S7-1200 S7-300/400/WinAC


Unrestricted © Siemens 2020
Programming with SCL in STEP 7

Live demo
▪ Online view of the project tree
▪ Monitoring blocks
▪ Break points
▪ Watch tables
▪ Forcing of inputs and outputs

Unrestricted © Siemens 2020


S7 - SCL

What is S7 – SCL ?
1

1.1
2

1.2 Language description


3

4
1.3 Compile and test

5
1.4 Source code generation
6

Unrestricted © Siemens 2020


Page 35 8/12/2020
Source files
Create source files

Easily create source code from a SCL block!

Create source code


from the block

My_program.SCL

Unrestricted © Siemens 2020


Source files
Create source file: from several selected block

Creating a source code from several blocks

Create source code


from selected
blocks

My_program.SCL

Unrestricted © Siemens 2020


Source files
Import external SCL Source files

External SCL source files can be easily imported into TIA Portal!

1 Import external
source file
Select .SCL File.
Also source files
from STEP 7 V5.x

Unrestricted © Siemens 2020


Source files
Import external SCL Source files

From the imported SCL source file, blocks will be generated

3
Generate blocks from
source file

Blocks with similar


names will be
overwritten

Unrestricted © Siemens 2020


S7 Programming language

1 Overview S7 Programming language


2

2 SIMATIC Programming with S7-SCL


3

4
3 SIMATIC Programming with S7-Graph

5
4 Hand-on experience

5
6
5 Q&A
6

Unrestricted © Siemens 2020


Page 40 8/12/2020
TIA Portal

S7 – Graph: Sequencer Programming

Unrestricted / © Siemens VN 2020


Exercise: S7-GRAPH sequence in TIA Portal

S7-GRAPH-sequence:
bottling plant for fruit juice

Action:
Step: transport for mixing Activate conveyer belt
(Output Q0.0)
Transition:
Mixer reached
(Input I0.0)

Action:
Step: Mixing Activate Mixer for 10s
(Output Q0.1)
Conveyer belt is empty
(I0.1) and step Mixing is
11s active

Action:
Step: Transport to „Bottling“ Activate conveyer belt
(Output Q0.2)

Bottling reached
(Input I0.2)

Unrestricted © Siemens 2020


S7-GRAPH

2.1 Introduction
2

2.2 Handling
3

4
2.3 Elements

5
2.4 Actions

5
6

5
2.5 Compile and Test
6

Unrestricted © Siemens 2020


Page 43 8/12/2020
S7-GRAPH

2.1 Introduction
2

2.2 Handling
3

4
2.3 Elements

5
2.4 Actions

5
6

5
2.5 Compile and Test
6

Unrestricted © Siemens 2020


Page 44 8/12/2020
Intuitive program development for
sequential functions with SFC (S7-GRAPH)
Sequential Function Chart (S7-
GRAPH) for sequential process
S1 flows
Transport Step
▪ Graphic program development
▪ Structured program design
▪ Up to 50% time savings*
T1 ▪ Process description
Transition
Trans ▪ Easily readable, easily understandable
▪ Describe time sequences
▪ Steps
S2 ▪ Transitions
Filling Step
▪ Integrated diagnostic functions, e.g. monitoring
maximum time for executing a step
▪ Certified according to PLCopen Base Level

* compared to programming with equal functions with LAD, FBD, STL

Unrestricted © Siemens 2020


Basic components of S7-GRAPH

Definition
The actions to be executed are defined
S1 within the individual steps. There are
Transport Step
transitions between the steps. These contain
conditions for advancing to the next step.

T1 Step
Transition Steps consist of Actions which are carried
Trans
out when the step becomes active

Transition
S2 Transitions are located between the steps
Filling Step
and contain the conditions for advancing to
the next step

Unrestricted © Siemens 2020


S7-GRAPH

2.1 Introduction
2

2.2 Handling
3

4
2.3 Elements

5
2.4 Actions

5
6

5
2.5 Compile and Test
6

Unrestricted © Siemens 2020


Page 48 8/12/2020
Handling
Create a new S7-GRAPH block

Programming
Editor features
language

Favorite bar

Function block

Components of a new
S7-GRAPH block
Advantages:
▪ The S7-GRAPH block cannot be overwritten in the language STL unlike STEP 7 Classic!

Unrestricted © Siemens 2020


Handling
Sequence views

Permanent pre- Alarm properties


instructions

Permanent post-
instructions
Sequence view

Single step

Unrestricted © Siemens 2020


Handling
Permanent pre- and post-instructions

Permanent instructions allow you to create


program code that is executed before or Permanent pre-
instructions
after the sequencer is executed
Permanent post-
▪ In LAD or FBD instructions
▪ Maximum 32 LAD or
FBD instructions
▪ Maximum 250 pre-
and 250 post-
instructions

Unrestricted © Siemens 2020


Handling
Sequence view (1)

The sequence view shows the structure of the


sequencer and enables to add the following Sequence view
elements to it

▪ Steps
▪ Transitions
▪ Jumps
▪ Branches
▪ Sequence ends

The sequence view is meant to be used for


general structuring of the sequence

Unrestricted © Siemens 2020


Handling
Sequence view (2)

Advanced view of steps and transitions

Even in sequence view it is


possible to expand and edit
Advanced step view
▪ Steps
▪ Transitions

Without changing to single


step view
Advanced transition
view

Unrestricted © Siemens 2020


Handling
Single step view
Provides the option of programming the following elements of a step

▪ Interlock
▪ Supervision
▪ Actions (step) Single Step
▪ Conditions (transition)

In the single step view it is not


possible to change the structure
of the sequence

It is possible to switch between


the steps by the navigation
pane

Unrestricted © Siemens 2020


Handling
Alarms

Properties of the Interlock and


Supervision messages
Messages

▪ Activate messages
▪ Acknowledge necessary
▪ Alarm properties

▪ Messages can individually be


deactivated/activated

Unrestricted © Siemens 2020


Interlock and Supervision:
Configure alarms

Activate alarms

Acknowledge at HMI

Alarm properties
Properties of
alarms
Select Supervision
or Interlock …

… open properties…

Generic alarm text

… add individual
alarm text
Unrestricted © Siemens 2020
Handling
Alarms in HMI
Create Alarm classes

Choose alarm class

Activate alarm class


in HMI properties

Unrestricted © Siemens 2020


S7-GRAPH

2.1 Introduction
2

2.2 Handling
3

4
2.3 Elements

5
2.4 Actions

5
6

5
2.5 Compile and Test
6

Unrestricted © Siemens 2020


Page 58 8/12/2020
Step

Only actions of a active step Single step


will be processed

A step becomes active, if


▪ The preceding transition is
active and the conditions are
true
▪ It is a initial step and the
sequence was initialized
▪ It is called by an event-
dependent action

A step might be empty

Unrestricted © Siemens 2020


Transition

A transition:

▪ contains the conditions for Transition


advancing to the next step

▪ only switches to the subsequent


steps when the conditions are
satisfied

▪ Might be empty – in this case it is


always “true”

Unrestricted © Siemens 2020


Alternative branch

Exclusive OR branch
Add alternative
branch
▪ Consist of several parallel
branches

▪ Begins and end with a transition

▪ If the conditions of multiple


transitions are satisfied
simultaneously, the transition
farthest to the left has the highest
priority and the corresponding
branch is executed
▪ The other branches will not be
executed

Unrestricted © Siemens 2020


Simultaneous branch
AND branch

▪ Consist of several parallel Add Simultaneous


branches branch

▪ Begins always with a step

▪ In a Simultaneous branch all


branches are active

▪ Branches that join together in a


transition will only advance to the
next step when all branches are
completely processed

Unrestricted © Siemens 2020


Sequence end

A sequence end terminates the


sequencer of a
Sequence end
▪ Linear sequence

▪ Branch

A sequence end at a simultaneous


branch only terminates this branch

Unrestricted © Siemens 2020


Jump

A jump

Jump
▪ Is the transit of a transition to any step
▪ within the sequence
▪ within a sequence of the same
function block

▪ Always behind a transition

▪ Terminates the sequence rather than


the branch

▪ Enables cyclic processing of the


sequencer

Unrestricted © Siemens 2020


Instructions

Permanent instructions allow you


to create program code that is
executed before or after the Permanent pre-
sequencer is processed instructions

Permanent post-
The results can be used for instructions
several transitions in case of
often used conditions

Unrestricted © Siemens 2020


S7-GRAPH

2.1 Introduction
2

2.2 Handling
3

4
2.3 Elements

5
2.4 Actions

5
6

5
2.5 Compile and Test
6

Unrestricted © Siemens 2020


Page 66 8/12/2020
Actions
Actions consist of instructions for
process control

▪ Control Outputs, flags,


DB’s

▪ Activate/Deactivate other
steps of the sequencer

▪ Call functions and


function blocks

Unrestricted © Siemens 2020


Actions

Actions consist of instructions


for process control
▪ Control Outputs, flags, DB’s
▪ Activate/Deactivate other steps of
the sequencer
▪ Call functions and function blocks

And consist of
▪ An interlock (optional)
▪ An event (optional)
▪ An identifier
▪ An operand, assignment or block
call

Unrestricted © Siemens 2020


Actions
Identifier (standard actions)

Interlock Identifier Data type Meaning

Signal state of the operand is „true as long the step is active


[C] N BOOL, FB, FC, SFB, SFC
Specified block is called as long as the step is active

[C] S BOOL As soon as the step is active, the operand is set to “true”

[C] R BOOL As soon as the step is active, the operand is set to “false”

n seconds after the step activation, the operand is set to


[C] D BOOL “true" and remains at “true“ until deactivation of the step

Constant/TIME/DWORD

When the step is active, the operand is set to "1" for n


[C] L BOOL
seconds

Constant/TIME/DWORD

Unrestricted © Siemens 2020


Actions
Identifier (special actions)

Interlock Event Identifier Data types Meaning


[C] A, L, R, S, V ON Step Activation of a step within the function block
[C] A, L, R, S, V OFF Step Deactivation of a step within the function block
CD, CS, CR, Counter – count down (D), set initial value (S), reset
[C] A, L, R, S, V Counter
CU counter (R) und count up (U)
Retentive on-delay (D), extended pulse (L) and stop
[C] A, L, R, S, V TD, TL, TR Timer
timer and reset (R)
TF Timer Off delay

When the "TL", "TD", and "TF" timers are used, you must specify the duration. Use the following
syntax for this:
<Duration> = IWy, QWy, MWy, LWy, DBWy, DIWy; tag of type S5TIME or WORD; S5T#Constant

Unrestricted © Siemens 2020


Events

You have the option of linking an action with an event in order to make the execution of
the action dependent on certain conditions.
For actions with identifiers "D", "L", and "TF", the linking with events is not possible

Interlock Event Evaluation Description


-(C)- S1 Positive edge Step is activated
S0 Negative edge Step is deactivated
-(C)- V1 Positive edge Supervision condition is satisfied -> fault occurs
V0 Negative edge Supervision condition is no longer satisfied – fault is eliminated
L0 Positive edge Interlock condition is satisfied -> fault is eliminated
L1 Negative edge Interlock condition is not satisfied -> fault occurs
-(C)- A1 Positive edge Alarm is acknowledged
-(C)- A1 Positive edge Incoming registration

Unrestricted © Siemens 2020


Event
Signal evaluation of a step

S5 N Step 5
Step5
S1 Step 5
S0 Step 5

T5 Step 6 S1 S0
active
Trans5
Step 6
Not active
CPU cycles
S6
Step6

Interlock Event Identifier Action


T8
S0 N %M0.0
Trans8
S1 N %M0.1
N %M0.2

Unrestricted © Siemens 2020


Step transition

S5 N M0.0 Step 6 N
Step5 Step 6 S1
true
Step 5 N
Step 5 S0
T5
active
Trans5
Not active
CPU cycles
S6 N M1.0
Step6
true
During step transition are active:
T8 ▪ S0 of the predecessor
Trans8 ▪ S1 of the successor
▪ N of the successor

Unrestricted © Siemens 2020


Interlock und Supervision: additional functions in a Step

Interlock function contains the logic for Alarm


the condition optional

Supervision function Alarm


is watching your steps optional

S2
Filling Step Within the steps, actions are formulated
Optional: Action will be only executed, if the
interlock condition is true.

Unrestricted © Siemens 2020


Interlock

An interlock is used to program


conditions on which the execution of the
individual actions depends

If the interlock condition is true all linked


actions are executed

If the interlock condition is not satisfied, a


fault exists:
▪ with C linked action are not executed
▪ Interlock fault is reported (event L1)
▪ does not affect the advancement to the next
step

Unrestricted © Siemens 2020


Supervision
A supervision is a programmable
condition to monitor a step

If the supervision condition is satisfied


▪ A fault exists (event V1)

▪ The step remains active


▪ The following transition is not
evaluated

▪ The step concerned stays active

▪ Step activation time <step name>.U


is stopped

Unrestricted © Siemens 2020


S7-GRAPH

2.1 Introduction
2

2.2 Handling
3

4
2.3 Elements

5
2.4 Actions

5
6

5
2.5 Compile and Test
6

Unrestricted © Siemens 2020


Page 77 8/12/2020
Properties of the S7-GRAPH Editor and Compiler

Preferences understandable and well arranged in comparison to S7-GRAPH V5.x


S7-GRAPH V5.3
S7-GRAPH in STEP 7 Prof

Preferences for
Interface and DB

Compile in S7-300/400
and WinAC
automatically by
standard FC72/73

Unrestricted © Siemens 2020


Test of a S7-GRAPH sequence

Preferences understandable and well arranged in comparison to S7-GRAPH V5.x


S7-GRAPH in STEP 7 Prof
S7-GRAPH V5.3

Semiautomatic Taskcard
„Testing“

Step mode

Manual mode

Unrestricted © Siemens 2020


Test of a S7-GRAPH sequence

Preferences understandable and well arranged in comparison to S7-GRAPH V5.x

Active step

Transition satisfied

Synchronized step

Preferences for
synchronization
Before activation:
mark step
Unrestricted © Siemens 2020
Test of a S7-GRAPH sequence

Monitoring

Track active step

Actions

Further test
properties

Transition

Unrestricted © Siemens 2020


Interlock and supervision: well arranged Online view

Supervision
triggered
Interlock triggered

Unrestricted © Siemens 2020


S7 Programming language

1 Overview S7 Programming language


2

2 SIMATIC Programming with S7-SCL


3

4
3 SIMATIC Programming with S7-Graph

5
4 Hand-on experience

5
6
5 Q&A
6

Unrestricted © Siemens 2020


Page 84 8/12/2020
Exercise: S7-GRAPH sequence in TIA Portal

S7-GRAPH-sequence:
bottling plant for fruit juice

Action:
Step: transport for mixing Activate conveyer belt
(Output Q0.0)
Transition:
Mixer reached
(Input I0.0)

Action:
Step: Mixing Activate Mixer for 10s
(Output Q0.1)
Conveyer belt is empty
(I0.1) and step Mixing is
11s active

Action:
Step: Transport to „Bottling“ Activate conveyer belt
(Output Q0.2)

Bottling reached
(Input I0.2)

Unrestricted © Siemens 2020


S7 Programming language

1 Overview S7 Programming language


2

2 SIMATIC Programming with S7-SCL


3

4
3 SIMATIC Programming with S7-Graph

5
4 Hand-on experience

5
6
5 Q&A
6

Unrestricted © Siemens 2020


Page 86 8/12/2020
Thank you for your attention!

With best regards,


Tran Van Hieu
SITRAIN Manager
Digital Industries, Siemens Vietnam
33 Le Duan, Ben Nghe Ward, District 1, Ho Chi Minh City, Vietnam
Tel: +84 (0) 911 585 115
Email: tran-van.hieu@siemens.com

Subject to changes and errors. The information given in this document only contains general descriptions and/or performance features which may
not always specifically reflect those described, or which may undergo modification in the course of further development of the products. The requested
performance features are binding only when they are expressly agreed upon in the concluded contract.
All product designations, product names, etc. may contain trademarks or other rights of Siemens AG, its affiliated companies or third parties.
Their unauthorized use may infringe the rights of the respective owner.

siemens.com

Unrestricted © Siemens 2020


Page 87

You might also like