The preset function is used to set/reset the counter operation.
The preset function authorizes counting function, synchronization, and start in the following counting modes:
oOne shot counter: preset and start the counter
oModulo-loop counter: reset and start the counter
oEvent counting: restart the internal time base at the beginning
NOTE: Sync condition for a Simple HSC type corresponds to the function block input Sync.
This function is used to synchronize the counter depending on the status and the configuration of the optional SYNC physical input and the function block inputs F_Preset and EN_Preset.
This diagram illustrates the Sync conditions of the HSC:
EN_Preset input of the HSC function block
F_Preset input of the HSC function block
SYNC physical input SYNC
The function block output Preset_Flag is set 1 when the Sync Condition is reached.
Either of the following events trigger the capturing of the Sync Condition:
oRising edge of the F_Preset input
oRising edge, falling edge, or rising and falling edge, of the SYNC physical input (if the SYNC input is configured, and the EN_Preset input is TRUE).
Step |
Action |
---|---|
1 |
In the Devices tree, double-click MyController > Counters. |
2 |
Set the value of the Counting function parameter to HSC Main Single Phase or HSC Main Dual Phase. |
3 |
Select the value of the Control inputs > SYNC input > Location parameter. |
4 |
Select the value of the Control inputs > SYNC input > Bounce filter parameter. |
5 |
Select the value of the Control inputs > SYNC input > Preset condition parameter to specify the transition type of the SYNC physical input: oSYNC Rising. Rising edge of the SYNC input oSYNC Falling. Falling edge of the SYNC input oSYNC Both. Both edges of the SYNC input |