Program Structure; Linear Programming - Siemens SIMATIC S5-115U User Manual

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

Introduction to STEP 5
Example: Hard-Wired Control
A signal lamp is supposed to light up when a normally open contact (S1) is activated
and a normally closed contact (S2) is not activated.
Programmable Control
The signal lamp is connected to a PLC output (Q 2.0). The signal voltages of the two
contacts are connected to two PLC inputs (I 1.1 and I 1.2). The PLC scans to see if the
signal voltages are present (signal state "1" at the activated normally open contact or
nonactivated normally closed contact). Both signal states are combined through logic
AND. The result of logic operation (RLO) is assigned to output 2.0 (the lamp lights up).
Circuit Diagram
S1
A
S2
A
=
7.2

Program Structure

An S5-115U 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

When processing simple automation tasks, it is enough to program the individual operations in
one block.
In the case of the S5-115U, this is organization block 1 (OB1) (see Section 7.3.1). This block is
scanned cyclically, i.e. after processing the last statement, the processor returns to the first
statement.
Please note the following:
When OB1 is called, five words are assigned to the block header (see Section 7.3.1).
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 calcu-
lating the program length.
Like all blocks, OB1 must be terminated by a Block End statement (BE).
7-4
STL
I 1.1
I 1.1
I 1.2
I 1.2
Q 2.0
CSF
I 1.1
&
Q 2.0
S5-115U Manual
LAD
I 1.2
Q 2.0
( )
EWA 4NEB 811 6130-02b

Advertisement

Table of Contents
loading

Table of Contents