Siemens S7-1200 System Manual page 221

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

The number of counters that you can use in your user program is limited only by the amount
of memory in the CPU. Counters use the following amount of memory:
● For SInt or USInt data types, the counter instruction uses 3 bytes.
● For Int or UInt data types, the counter instruction uses 6 bytes.
● For DInt or UDInt data types, the counter instruction uses 12 bytes.
These instructions use software counters whose maximum counting rate is limited by the
execution rate of the OB in which they are placed. The OB that the instructions are placed in
must be executed often enough to detect all transitions of the CU or CD inputs. For faster
counting operations, see the CTRL_HSC instruction (Page 409).
Note
When you place counter instructions in an FB, you can select the multi-instance DB option,
the counter structure names can be different with separate data structures, but the counter
data is contained in a single DB and does not require a separate DB for each counter. This
reduces the processing time and data storage necessary for the counters. There is no
interaction between the counter data structures in the shared multi-instance DB.
Operation of the counters
Table 7- 25
Operation of CTU (count up)
Counter
The CTU counter counts up by 1 when the value of parameter CU
changes from 0 to 1. The CTU timing diagram shows the operation for
an unsigned integer count value (where PV = 3).
If the value of parameter CV (current count value) is greater than or
equal to the value of parameter PV (preset count value), then the
counter output parameter Q = 1.
If the value of the reset parameter R changes from 0 to 1, then the
current count value is reset to 0.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
7.3 Counter operations
Operation
Basic instructions
221

Advertisement

Table of Contents
loading

Table of Contents