Siemens SIMATIC S5-95F Manual page 89

Table of Contents

Advertisement

Installing and Connecting the Basic System
Using Counters A and B Separately
The counters must be parameterized in DB1 (see COM 95F manual). Counters A and B count
independent of each other.
When the counters reach the parameterized comparison value (counter overflow), then
an interrupt is triggered and OB3 is called, if it has been programmed
bit 61.0 in the IB 61 diagnostic byte is set to "1" (for counter A), irrespective of the presence of
OB3
bit 61.1 in the IB 61 diagnostic byte is set to "1" (for counter B), irrespective of the presence of
OB3
the counter is reset to "0", irrespective of the presence of OB3.
The "set" bits in the diagnostic byte, indicating a counter overflow can be reset in OB3 with the
following operations:
Table 4-7. Resetting the Diagnostic Byte in the Program after a Counter Overflow
Example
After counter overflow,
the corresponding bit in
the diagnostic byte is to
be reset.
Cascading of Counters A and B
Instead of using counters A and B individually and independently of each other, you can combine
(cascade) the two counters. Use cascading counters if you want to count amounts larger than
65,535 (up to 4,294,967,295). The registers of both counters work together like a large counter with
more digits. If you cascade both counters, counter input B is automatically disabled; that is why you
must transfer the incoming pulses to counter input A.
If the cascaded counter exceeds the comparison value, then
the interrupt is triggered and OB3 is called, if it has been programmed,
bit 61.0 and bit 61.1 in the diagnostic byte are set simultaneously to "1", independent of the
presence of OB3,
the counter is reset to "0".
The "set" bits in the diagnostic byte indicating a counter overflow or reaching of the comparison
value can be reset with the operations R I 61.0 and R I 61.1.
You can scan the counter status and reset it to "0". The same operations are available as for the
individual counters.
4-20
R I 61.0 for counter A
R I 61.1 for counter B.
STL
OB3
Counter A counted until comparison value was
A
I
61.0
reached, interrupt was triggered.
Reset bit 0 in the diagnostic byte to "0".
R
I
61.0
The counter reaction program in FB3 is executed.
JC
FB3
.
.
.
BE
or
Explanation
S5-95F
EWA 4NEB 812 6210-02

Advertisement

Table of Contents
loading

Table of Contents