Technology instructions
10.1 Counting (High-speed counters)
S7-1200 Programmable controller
578 System Manual, V4.2, 09/2016, A5E02486680-AK
Each time the CPU goes to RUN, it loads initial values. The initial values are only used in
count mode:
● Initial counter value: The program sets the current count value to the initial counter value
when the CPU goes from STOP to RUN mode or when the program triggers the sync
input.
● Initial reference value: When the current count reaches the reference value, if the
respective functions are set up, the program generates an interrupt and/or an output
pulse.
● Initial reference value 2: When the current count reaches the reference value 2, if the
function is set up, the program generates an output pulse.
● Initial upper limit value: Maximum counting value. The default is the largest possible value
of +2,147,483,647 pulses.
● Initial lower limit value: Minimum counting value. The default is the smallest possible
value of -2,147,483,648 pulses.
The values above and the behavior of the counter when it reaches a limit are only available
in Count mode. You can adjust the values and the behavior with the CTRL_HSC_EXT
instruction using the HSC_Count SDT.
The Clock and direction inputs determine count events and direction, based upon the
operating phase. You can only use the Sync, Capture, and Gate inputs in Count mode and
can individually enable and configure the inputs for different types of triggers.
The Sync (synchronization) input sets the current count value to the starting (or initial
counter) value. You typically use the Sync input to reset the counter to "0". You can trigger
the Sync when the input pin is in one of the following states:
● High
● Low
● Goes from low to high
● Goes from high to low
● Goes from high to low or from low to high