Programming instructions
6.1 Basic instructions
TONR:
ON-delay
Retentive
timing
diagram
6.1.3
Counters
6.1.3.1
Counters
You use the counter instructions to count internal program events and external process
events:
● CTU is a count up counter.
● CTD is a count down counter.
● CTUD is a count up and down counter.
Each counter uses a structure stored in a data block to maintain counter data. You assign
the data block when the counter instruction is placed in the editor. 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.
When you place counter instructions in a function block, you can select the Multi-instance
data block option, the counter structure names can be different with separate data
structures, but the counter data is contained in a single data block and does not require a
separate data block 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 data block.
102
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02