Principle Of Operation; Activating Counting; Generating The Actual Value; Counting Range And Overrange - Siemens Simatic S5 IP 240 Manual

Counter/positioning/position decoder module
Hide thumbs Also See for Simatic S5 IP 240:
Table of Contents

Advertisement

IP 240
8
Counting
8.1
Applications
In this mode, the IP 240 can be universally used for pulse counting. The module can process pulse
trains with frequencies of up to 70 kHz.
8.2

Principle of Operation

For the counting mode the following STEP 5 modules are necessary:
A data block
You must create a data block (DB) prior to calling the configuring function block for the first
time. New data must be entered in this DB prior to its transfer to the IP 240 by the FB 172.
Data that is read from the IP 240 is stored in this DB by control FB 172.
Configuring FB 171
You structure one or both channels of the IP 240 in position decoding mode with configuring
FB 171. The configuring FB is normally called in the restart OB.
Control FB 172
The control FB 172 is called in the cyclic program or the interrupt program. By means of the FB
parameter FKT you can specify whether data is to be read from or transferred to the IP 240.
8.2.1
Actual Value

Activating counting

Counting is activated with a positive-going edge of the gate signal. You can preset the gate signal
with control bit STRT or via an external signal at input GT. On configuration, you must specify in
parameter EXT, configuring FB 171, whether you are using STRT or GT as a gate signal.
If you use control bit STRT, you must first transfer the control bits with STRT=1 to the IP to form a
positive-going gate edge. Set STRT bit D 17.4 to "1" in the data block. Now call control FB 172 and
initialize it for function 2 "Writing control statements". The CPU then transfers the control bits to
the IP.

Generating the actual value

The pulses are counted on their positive-going edge while the gate signal is active. The counter
counts down from an initial value ANF. After the actual value has crossed zero, the pulses are
acquired with a negative sign if the gate signal is still active.

Counting range and overrange

The permissible counting range is defined from +9,999 to - 9,999. When the defined counting
range is exceeded, the counter enters the overrange.
9,999
...
Defined counting range
Fig. 8-1. Actual Value Range and Overrange in Counting Mode
EWA 4NEB 811 6120-02a
2
1 0 - 1- 2
...
- 9,999
0 - 1- 2
...
Overrange
Counting
- 9,999
8-1

Advertisement

Table of Contents
loading

Table of Contents