Scanning And Resetting The Counter Status - Siemens SIMATIC S5-95F Manual

Table of Contents

Advertisement

S5-95F
4.5.3

Scanning and Resetting the Counter Status

Table 4-8 shows the different possibilities of scanning the counters. The table is followed by a
program example that shows how to enter a new comparison value.
Table 4-8. Addresses and Counter Access Possibilities
Location of counters
Scanning the counter status
by reading in the PII
(the value read in corresponds to the last signal state read into
the PII.)
by direct I/O access
(the value read in corresponds to the current signal state.)
Reset counter status to "0" and input new comparison value.
1
x = Comparison value, up to which the counter should count (you must enter this to enable triggering of an interrupt)
Example: Presetting a new comparison value for counter A.
STL
OB3
A
I
61.0
R
I
61.0
JC
FB 10
BE
STL
FB10
L
KF
x
T
PW
36
BE
EWA 4NEB 812 6210-02
Addresses and Counter Access Possibilities
Counter A counted until a comparison value was
reached. An interrupt was triggered. Reset the set bit
61.0 in the diagnostic byte.
The program branches to FB10.
Reaction to "comparison value reached" in the user
program.
Load the new comparison value x into ACCU 1 and
set counter A
Installing and Connecting the Basic System
Counter A:
Counter B:
L
L
L
L
L
T
T
Explanation
Explanation
IB 36 ... 37
IB 38 ... 39
IW
36
IW
38
PW
36
PW
38
1
KF
x
PW
36
PW
38
4-21

Advertisement

Table of Contents
loading

Table of Contents