Programm Structure; Linear Programming - Siemens SIMATIC S5-95F Manual

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 (Q 32.5). The signal voltages of the two
contacts are connected to two PLC inputs (I 32.0 and I 32.1).
The PLC 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 32.5 (the lamp lights up).
Circuit Diagram
S1
S2
H1
7.2

Programm Structure

A program can be of linear or structured type.
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 programmable controllers, this is organization block 1 (OB1) (see section 7.3.1). The PLC
scans this block cyclically (i.e., after it scans the last statement, it goes back to the first statement
and begins scanning again).
Please note the following:
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").
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
AN I 0.1
I 0.1
=
A 1.0
CSF
&
Q 1.0
S5-95F
LAD
I 0.0
I 0.1
Q 1.0
( )
Count these
EWA 4NEB 812 6210-02

Advertisement

Table of Contents
loading

Table of Contents