Specifications

IP 240 Counting
8.2.2 Final Value
Storing the final count
When you evaluate the actual value, you are evaluating the current count. The IP also makes the
actual value of the preceding count available, i.e. the count value at the instant of the first
negative GATE signal. This is referred to as the final count. This value is retained until the next
negative GATE signal, and can be read out from the IP.
When the final value is stored at termination of counting, status bit REF2 is set.
When it is ”1”, REF2 can trigger an interrupt. You must specify this option in the PRA parameter
during a configuring pass ( Section 8.3.1).
REF2 is reset when the status area is read.
Reading the final value
Before you can read out the current final vaue from the DB, you must first invoke control FB 172
and initialize it for function ”1” Read actual value, final value and status bits”.
The CPU then transfers the current data from the IP to the data block. The data for the final value
is entered as follows:
DW 28 Absolute final value in binary
D 27.0 Sign of the final value (SGF)
Overrange
If the actual value is already in the overrange at the instant of the negative GATE signal edge,
status bit UEBE is set. UEBE is the overrange bit for the final value.
Overwriting an old final value
Every negative GATE signal edge overwrites the last final value with the new final value. If the
status area (function 1, FB 172) was not read between two negative GATE edges, the UEBS bit is
set on the IP. UEBS is the status bit for Overwrite.
When it is set, the UEBS bit can trigger an interrupt. You must specify this option in the PRA
parameter.
Reading of the status area resets UEBS.
8.2.3 Forcing the IP Output
With control bits DA1F and DA1S in DL 17 you define how digital output D1 is to be forced. Enter
the required value in DL 17. Now call control FB 172 and initialize it for function 2 ”Write control
statements”. The CPU then transfers the control bits to the IP.
EWA 4NEB 811 6120-02a
8-3