Technology instructions
10.1 Counting (High-speed counters)
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
561
CTRL_HSC_EXT Instruction System Data Types (SDT)
The following System Data Types (SDTs) are only used with the CTRL_HSC_EXT
instruction’s CTRL pin. To use them, create a user data block and add an object with the
data type of the SDT that corresponds to the HSC’s configured mode (type of counting). TIA
Portal V14 does not show these data types in the dropdown menu so the name of the SDT
must be typed exactly as shown.
Inputs of the HSC’s SDT are denoted by the prefix "En" or "New". Inputs prefixed with "En"
either enables an HSC function or updates the corresponding parameter. The prefix "New"
identifies the update value. In order for the new value to take effect, the corresponding "En"
bit must be true, and the "New" value must be valid. When the CTRL_HSC_EXT instruction
is executed, the program applies input changes and updates the outputs with the appropriate
SDT reference attached.
The "HSC_Count" data type corresponds to an HSC configured for "Count" mode. The
Count mode provides the following capabilities:
● Access the current pulse count
● Latch the current pulse count on an input event
● Reset the current pulse count to the starting value on an input event
● Access status bits, indicating certain HSC events have occurred
● Disable the HSC using a software or hardware input
● Change the counting direction using a software or hardware input
● Change the current pulse count
● Change the starting value (used when CPU transitions to RUN state or when Sync
function is triggered)
● Changing two independent reference (or preset) values used for comparison
● Change the upper and lower counting limits
● Change how the HSC operates when the pulse count reaches those limits
● Generate a hardware interrupt event when the current pulse count reaches a reference
(preset) value
● Generate a hardware interrupt event when the Synchronization (reset) input activates
● Generate a hardware interrupt event when the counting direction changes based upon an
external input
● Generate a single output pulse on a specified counting event
When an event occurs and the CTRL_HSC_EXT instruction executes, the instruction sets a
status bit. On the following CTRL_HSC_EXT instruction execution, the instruction clears the
status bit, unless the event occurs again before the instruction executes.