Program Structure; Linear Programming - Siemens S5-100U User Manual

Simatic s5 programmable controller
Hide thumbs Also See for S5-100U:
Table of Contents

Advertisement

Introduction to STEP 5
Example: Hard-Wired Control
A signal lamp (H1) is supposed to light up when a normally open contact (S1) is acti-
vated and a normally closed contact (S2) is not activated.
Programmable Control
The signal lamp is connected to an output (i.e., Q 1.0). The signal voltages of the two
contacts are connected to two programmable controller inputs (i.e., I 0.0 and I 0.1).
The S5-100U scans to see if the signal voltages are present (signal state "1" at the
activated normally open contact or non-activated normally closed contact). Both signal
states are combined through logic AND. The result of logic operation (RLO) is assigned
to output Q 1.0 (the lamp lights).
Circuit Diagram
S1
S2
H1
7.2

Program Structure

An S5-100U program can be one of the two following types:
Linear
Structured
Sections 7.2.1 and 7.2.2 describe these program types.
7.2.1

Linear Programming

Programming individual operations in one section (block) is sufficient for handling simple automation
jobs. For the S5-100U, this is organization block 1 (see section 7.3.1). The S5-100U scans this
block cyclically. After the S5-100U scans the last statement, it goes back to the first statement and
begins scanning again. Please note the following rules:
When OB1 is called, five words are assigned to the block header in the program memory (see
section 7.3).
Normally, a statement takes up one word in the program memory.
Two-word statements also exist (e.g., with the operation "Load a constant"). Count these
statements twice when calculating the program length.
Like all blocks, OB1 must be terminated by a Block End statement (BE).
7-4
STL
A
I 0.0
I 0.0
A
I 0.1
I 0.1
=
Q 1.0
CSF
I 0.0
&
Q 1.0
S5-100U
LAD
I 0.1
Q 1.0
( )
EWA 4NEB 812 6120-02

Advertisement

Table of Contents
loading

Table of Contents