Hide thumbs Also See for S7-1200:
Table of Contents
Technology instructions
9.1 High-speed counter
Parameter and type
BUSY
OUT
3
STATUS
OUT
If an update of a parameter value is not requested, then the corresponding input values are ignored.
1
The DIR parameter is only valid if the configured counting direction is set to "User program (internal direction control)".
2
You determine how to use this parameter in the HSC device configuration.
For an HSC on the CPU or on the SB, the BUSY parameter always has a value of 0.
3
You configure the parameters for each HSC in the device configuration for the CPU for
counting/frequency function, reset options, interrupt event configuration, hardware I/O, and
count value address.
Some of the parameters for the HSC can be modified by your user program to provide
program control of the counting process:
● Set the counting direction to a NEW_DIR value
● Set the current count value to a NEW_CV value
● Set the reference value to a NEW_RV value
● Set the period value (for frequency measurement mode) to a NEW_PERIOD value
If the following Boolean flag values are set to 1 when the CTRL_HSC instruction is executed,
the corresponding NEW_xxx value is loaded to the counter. Multiple requests (more than
one flag is set at the same time) are processed in a single execution of the CTRL_HSC
instruction.
● DIR = 1 is a request to load a NEW_DIR value, 0 = no change
● CV = 1 is a request to load a NEW_CV value, 0 = no change
● RV = 1 is a request to load a NEW_RV value, 0 = no change
● PERIOD = 1 is a request to load a NEW_PERIOD value, 0 = no change
The CTRL_HSC instruction is typically placed in a hardware interrupt OB that is executed
when the counter hardware interrupt event is triggered. For example, if a CV=RV event
triggers the counter interrupt, then a hardware interrupt OB code block executes the
CTRL_HSC instruction and can change the reference value by loading a NEW_RV value.
The current count value is not available in the CTRL_HSC parameters. The process image
address that stores the current count value is assigned during the hardware configuration of
the high-speed counter. You may use program logic to directly read the count value. The
value returned to your program will be a correct count for the instant in which the counter
was read. The counter will continue to count high-speed events. Therefore, the actual count
value could change before your program completes a process using an old count value.
HSC current count value: Program access, value range, and rollover behavior
The CPU stores the current value of each HSC in an input (I) address. The following table
shows the default addresses assigned to the current value for each HSC. You can change
the I address for the current value by modifying the properties of the CPU in the Device
Configuration.
410
Data type
Description
Bool
Function is busy
Word
Execution condition code
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Table of Contents
loading

Table of Contents