Technology instructions
9.1
High-speed counter
Table 9- 1
CTRL_HSC instruction
LAD / FBD
STEP 7 automatically creates the DB when you insert the instruction.
1
In the SCL example, "CTRL_HSC_0_DB" is the name of the instance DB.
2
Table 9- 2
Data types for the parameters
Parameter and type
HSC
DIR
1, 2
CV
1
RV
1
PERIOD
1
NEW_DIR
NEW_CV
NEW_RV
NEW_PERIOD
BUSY
3
STATUS
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
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
SCL
"CTRL_HSC_0_DB" (
hsc:=_hw_hsc_in_,
dir:=_bool_in_,
cv:=_bool_in_,
rv:=_bool_in_,
period:=_bool_in_,
new_dir:=_int_in_,
new_cv:=_int_in_,
new_rv:=_dint_in_,
new_period:=_int_in_,
busy:=_bool_out_,
status:=_word_out_);
Data type
IN
HW_HSC
IN
Bool
IN
Bool
IN
Bool
IN
Bool
IN
Int
IN
DInt
IN
DInt
IN
Int
OUT
Bool
OUT
Word
Description
Each CTRL_HSC instruction uses a structure stored in
a DB to maintain data. You assign the DB when the
CTRL_HSC instruction is placed in the editor.
Description
HSC identifier
1 = Request new direction
1 = Request to set new counter value
1= Request to set new reference value
1 = Request to set new period value
(only for frequency measurement mode)
New direction: 1= forward, -1= backward
New counter value
New reference value
New period value in seconds: 0.01, 0.1, or 1
(only for frequency measurement mode)
Function is busy
Execution condition code
9
315