Sample Programs - Siemens SIMATIC S5-100U System Manual

Simatic s5 series cpu 100/102/103
Hide thumbs Also See for SIMATIC S5-100U:
Table of Contents

Advertisement

S5-100U
8.5

Sample Programs

Sections 8.5.1 through 8.5.3 provide a few sample programs that you can enter and test in all three
methods of representation on a programmer.
8.5.1
Momentary-Contact Relay/Edge Evaluation
On each leading edge of the signal at input I 0.0, the AND
condition "A I 0.0 and AN F 64.0" is satisfied; the RLO is "1".
This sets flags F 64.0 and F 2.0 ("edge flags").
In the next processing cycle, the AND condition "A I 0.0 and
AN F 64.0" is not satisfied since flag F 64.0 has already been
set.
Flag 2.0 is reset.
Therefore, flag F 2.0 is "1" for only one program run.
When input I 0.0 is switched off, flag F 64.0 is reset.
This resetting prepares the way for evaluation of the next
leading edge of the signal at input I 0.0.
STL
A
I
0.0
AN
F
64.0
=
F
2.0
S
F
64.0
AN
I
0.0
R
F
64.0
NOP
0
8.5.2
Binary Scaler/Binary Divider
This section describes how to program a binary scaler.
Example: The binary scaler (output Q 1.0) changes its state each time I 0.0 changes its signal
state from "0" to "1" (leading edge). Therefore, half the input frequency appears at the
output of the flip-flop.
EWA 4NEB 812 6120-02b
Example
CSF
I 0.0
&
F 2.0
F 64.0
(#)
I 0.0
Circuit Diagram
I 0.0
F 64.0
F 2.0
I 0.0
F 64.0
F 64.0
S
I 0.0
R Q
STEP 5 Operations
I 0.0
F 2.0
LAD
F 2.0
F 64.0
(#)
S
R Q
8-71

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents