HSCSimple: HSC Simple Function Block
This function block controls a Simple type counter with the following reduced functions:
oone-channel counting
ono additional external I/O
ono threshold
ono event
ono capture
ono reflex
The HSCSimple function block is mandatory when using a Simple counter type.
The function block instance name must match the name defined by configuration. Hardware related information managed by this function block is synchronized with the MAST task cycle.
WARNING |
UNINTENDED OUTPUT VALUES |
oOnly use the Function Block instance in the MAST task. oDo not use the same Function Block instance in a different task. |
Failure to follow these instructions can result in death, serious injury, or equipment damage. |
NOTE: Forcing the logical output values of the FB is allowed by EcoStruxure Machine Expert but it will have no impact on hardware related outputs if the function is active (executing).
To see the general representation in IL or ST language, refer to Function and Function Block Representation.
This table describes the input variables:
Inputs |
Type |
Comment |
---|---|---|
Enable |
BOOL |
TRUE = authorizes changes to the current counter value. |
Sync |
BOOL |
On rising edge, presets and starts the counter. |
ACK_Modulo |
BOOL |
Modulo loop mode: On rising edge, resets the modulo flag Modulo_Flag. |
This table describes the output variables:
Outputs |
Type |
Comment |
---|---|---|
HSC_REF |
Reference to the HSC. |
|
Validity |
BOOL |
TRUE = indicates that the output values on the function block are valid. |
HSC_Err |
BOOL |
TRUE = indicates that an error was detected. Use the HSCGetDiag function block used to get more information about this detected error. |
Run |
BOOL |
TRUE = counter is running. In One-shot mode, switches to 0 when CurrentValue reaches 0. A rising edge on Sync is needed to restart the counter. |
Modulo_Flag |
BOOL |
Module loop mode: Set to TRUE when the counter rolls over the modulo value. |
CurrentValue |
DWORD |
Current count value of the counter. |