Function blocks
150 Function blocks for TwinSAFE logic components
3.22.2.1 Diagnostic and state information for the FB Counter
Table 3-138: Diagnostic information
No diagnostic information
The ActValue output has an underflow (is less than the smallest possible value)
The ActValue output has an overflow (is greater than the largest possible value)
Table 3-139: Diag Message
An underflow has occurred
Table 3-140: State information
RUN
In the RUN state the FB COUNT module sets the ActValue output to PresetValue if the
Reset input is TRUE.
If the Reset input is FALSE, the FB COUNT module increments the ActValue output when a
rising edge is detected at the CountUp input and decrements it when a rising edge is
detected at the CountDown input (this means ActValue remains unchanged when both
CountUp and CountDown inputs detect a rising edge).
The outputs assume the following values:
Error=0
CounterOut=(ActValue >= CounterLimit)
CounterZero=(ActValue == 0)
Reset=TRUE: ActValue=PresetValue
Reset=FALSE: ActValue=ActValue+n (-1 <= n <= 1)
STOP
The FB COUNT module assumes the STOP state if the input FbRun is FALSE.
The outputs assume the following values:
Error=0
CounterOut=0
CounterZero=0
ActValue=0
ERROR
If the FB COUNT module detects an error while checking the value range of CounterOut,
the FB COUNT module switches to the ERROR state and transmits the corresponding Diag
message to the GROUP module.
The outputs assume the following values:
Error=1
CounterOut=0
CounterZero=0
ActValue=0
RESET
The FB COUNT module assumes the RESET state if no further error is pending after an
error has occurred and the ErrAck input of the corresponding group is set to TRUE.
The outputs assume the following values:
Error=0
CounterOut=0
CounterZero=0
ActValue=0