140
Rockwell Automation Publication 2080-UM002L-EN-E - November 2021
Chapter 8 Use the High-Speed Counter and Programmable Limit Switch
HSC Commands (HScCmd)
HscCmd is an input parameter with data type USINT. All HSC commands
(1…4) are Level commands. Users are advised to disable the instruction before
updating the command.
HscCmd = 1
starts the HSC mechanism. Once the HSC is in running mode, the
HscCmd = 2
must be issued to stop counting. Setting the Enable input
parameter to False does not stop counting while in running mode.
HscCmd = 3 reloads the following parameter values: HighPreset, LowPreset,
OverFlow, UnderFlow, HighPreset Output, and LowPreset Output.
The parameter values shown in the Variable Monitor may not match the values
in the Hardware. Command 3 must be executed to load the values from the
variables to the hardware without stopping the HSC.
If the HSC Enable is True, HscCmd = 3 will continuously load the parameters.
Trigger HscCmd = 3 only once.
HscCmd = 4
(reset) sets the Acc value to the HSC AppData.Accumalator value.
The HscCmd =4 does not stop HSC counting. If HSC is counting when the
HscCmd =4 is issued, some counting may be lost.
To reset the Acc value and then continue the counting, trigger the HscCmd =4
only once. If the command is enabled continuously, it may cause errors.
HSC AppData.Accumalator value is updated automatically by the HSC
mechanism with the same value as the HSC Sts.Accumulator. To set one
HSC
HSC
HscCmd
STS
HscAppData
HscStsInfo
PlsData
Enable
Table 34 - HSC Parameters
Parameter
Parameter Type
Data Type
Parameter Description
Enable
Input
BOOL
Enable function block.
When Enable = TRUE, perform the HSC operation specified in “HSC command” parameter.
When Enable = FALSE, there is no HSC operation, and no HSC status update.
HscCmd
Input
USINT
HscAppData
Input
See HSC APP Data Structure on page
HSC application configuration. Only initial configuration is needed usually.
PlsData
Input
See array of Programmable Limit
Switch (PLS) Function on page 142
Programmable Limit Switch (PLS) Data
HscStsInfo
Output
HSC dynamic status. Status info is usualy continuously updated during HSC counting.
Sts
Output
UINT
HSC function block execution status