Sie sind auf Seite 1von 26

Block Architecture and the LAD / STL / FBD Editor

OB 1

FB

FB

FC

FB

FB

FB

FB

SIMATIC S7

Siemens AG 2008. All rights reserved.

FC

FC

Date:
File:

30.07.16
PRO1_06E.1

SITRAIN Training for


Automation and Industrial Solutions

Objectives
Upon completion of this chapter the participant will ...

SIMATIC S7

Siemens AG 2008. All rights reserved.

...

know the different types of S7 blocks

...

understand the principle of "structured programming"

...

know the meaning of the process images (PII, PIQ)

...

be able to explain the principle of cyclic program execution

...

know and be able to select the LAD, FBD and STL programming
languages

...

be able to edit, save and download a block with the LAD/STL/FBD


Editor

...

be able to carry out a simple program debugging with the "Monitor


Block" test function

Date:
File:

30.07.16
PRO1_06E.2

SITRAIN Training for


Automation and Industrial Solutions

Types of Program Blocks


Operating System

DB

DB

FC

FB

SFC

FB

FC

SFB

Cycle
Time
Process

OB
Organization
Blocks

Error
Legend:
OB
FB
FC
SFB
SFC
DB

= Organization Block
= Function Block
= Function
= System Function Block
= System Function
= Data Block

SIMATIC S7

Siemens AG 2008. All rights reserved.

Maximum nesting depth:


S7-300:
8
S7-400:

FB

(for each priority class,


2 to 4 additional levels for Error OBs)

FB with
Instance DB

Date:
File:

24

30.07.16
PRO1_06E.3

SITRAIN Training for


Automation and Industrial Solutions

Program Structuring Possibilities

Linear Program

Program Partitioned into Areas

Structured Program

Recipe A

OB 1

OB 1

Recipe B
Mixer

OB 1

Pump

Outlet

Outlet

All instructions are


found in one block
(usually in Organization
Block OB 1)

SIMATIC S7

Siemens AG 2008. All rights reserved.

The instructions for the individual


functions are found in individual
blocks. OB 1 calls the individual
blocks one after the other.

Date:
File:

30.07.16
PRO1_06E.4

Reusable functions are loaded into


individual blocks. OB 1 (or other
blocks) call these blocks and pass on
the pertinent data.

SITRAIN Training for


Automation and Industrial Solutions

Process Images
S1

K1

I 2.0

Q 4.3

PII

PIQ
User
Program

Byte 0
Byte 1
Byte 2
:
:
:

A
=

1
2

A
=

CPU Memory Area

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

:
:
I
Q
:
:
I
Q
:

2.0
4.3

Byte 0
Byte 1
Byte 2
:
:
:

6.4
4.3
CPU Memory Area

30.07.16
PRO1_06E.5

SITRAIN Training for


Automation and Industrial Solutions

Cyclic Program Execution


Startup program: Call and execution of OB 100
(once, after Power ON, for example)
Transfer PIQ to the digital output modules

Start of the cycle monitoring time

digital
input
module

CPU Cycle

Reading the input states from the digital input modules


and saving the states in the process image (PII)

Call and execution of OB1


(possible interruption by call of other OBs
for events such as time-of-day interrupt,
hardware interrupts etc. )

digital
output
module

Writing the process-image output table


(PIQ) in the digital output modules

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.6

SITRAIN Training for


Automation and Industrial Solutions

Inserting an S7 Block

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.7

SITRAIN Training for


Automation and Industrial Solutions

The LAD / STL / FBD Editor

Declaration Table

Code Section

Detail Window

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.8

SITRAIN Training for


Automation and Industrial Solutions

The STEP 7 Programming Languages


Function Block Diagram

Ladder Diagram

Statement List

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.9

SITRAIN Training for


Automation and Industrial Solutions

Selecting the Programming Language

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.10

SITRAIN Training for


Automation and Industrial Solutions

Programming in LAD and FBD

Insert
or
Overwrite
Mode

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.11

SITRAIN Training for


Automation and Industrial Solutions

Programming in STL

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.12

SITRAIN Training for


Automation and Industrial Solutions

Saving a Block

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.13

SITRAIN Training for


Automation and Industrial Solutions

Calling a Block in OB1

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.14

SITRAIN Training for


Automation and Industrial Solutions

Downloading Blocks into the PLC

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.15

SITRAIN Training for


Automation and Industrial Solutions

Simple Program Debugging

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.16

SITRAIN Training for


Automation and Industrial Solutions

Modifying Blocks
Open block
offline / online

Save (always offline)

SIMATIC S7

Siemens AG 2008. All rights reserved.

Download (always online)

Date:
File:

30.07.16
PRO1_06E.17

SITRAIN Training for


Automation and Industrial Solutions

Exercise 1: Jogging the Conveyor Motor (FC 16)

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.18

SITRAIN Training for


Automation and Industrial Solutions

Exercise 2: Calling FC 16 in OB 1

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.19

SITRAIN Training for


Automation and Industrial Solutions

If You Want to Know More

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.20

SITRAIN Training for


Automation and Industrial Solutions

Editor Customization: "General" Tab

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.21

SITRAIN Training for


Automation and Industrial Solutions

Editor Customization: "View" Tab

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.22

SITRAIN Training for


Automation and Industrial Solutions

Editor Customization: "STL" Tab

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.23

SITRAIN Training for


Automation and Industrial Solutions

Editor Customization: "LAD/FBD" Tab

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.24

SITRAIN Training for


Automation and Industrial Solutions

Editor Customization: "Block" Tab

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.25

SITRAIN Training for


Automation and Industrial Solutions

Editor Customization: "Sources/Source Text" Tab

SIMATIC S7

Siemens AG 2008. All rights reserved.

Date:
File:

30.07.16
PRO1_06E.26

SITRAIN Training for


Automation and Industrial Solutions

Das könnte Ihnen auch gefallen