FB_VIOLATIONCNT
Description Function Block
The FB_VIOLATIONCNT function block is used to implement a weighted error counter.
The bEnable input is used to activate or deactivate the counter. When the counter is deactivated, the bInputOK outputs are set to FALSE and ActViolationCnt is set to 0.
When bEnable is set to TRUE, the bInput input is checked each time the function block is called.
When the input
bInput = TRUE, the error counterActViolationCntis decremented by the valueuiDecrementNoError.Note: The input can be negated, in which case the input signal must be
FALSE.When the input
bInput = FALSE, the error counterActViolationCntis incremented by the valueuiIncrementError.Note: The input can be negated, in which case the input signal must be
TRUE.
As soon as the error counter reaches the maximum value udiCounterLimit, bInputOK is set to FALSE.
Tip
The availability of this function block depends on the state indicators FBSupportFlags of the ESI description file. These flags FBSupportFlags are evaluated as of CODESYS Safety for EtherCAT Safety Module 4.3.0.0.
The usage of this function block is prevented if the device in question does not explicitly support this function block.

Name | Data Type | Initial Value | Description, Parameter Values |
|---|---|---|---|
|
|
| Input for activating the function
|
|
|
| When the counter is activated, the input is checked each time the function block is called. . Input not negated
. Input negated
|
|
|
| Value by which the internal counter is incremented Only a constant value is permitted (no variable) |
|
|
| Value by which the internal counter is decremented Only a constant value is permitted (no variable) |
|
|
| Maximum value for the internal counter. Above this value, the Only a constant value is permitted (no variable) |
Name | Data Type | Initial Value | Description, Parameter Values |
|---|---|---|---|
|
|
| When |
|
|
| Indicates the current internal counter value when the input |