Function blocks
Function blocks for TwinSAFE logic components 127
3.17 The function block SUB
3.17.1 Functional description
The FB SUB is used to subtract the AnalogIn2 input from the AnalogIn1 input and transfer it to the
AnalogOut output. The input data types INT16, INT32, UINT16 and UINT32 are permitted. The output
must be selected to match the input types.
If an overflow or underflow occurs during the subtraction, the ERROR state is assumed. The AnalogOut
output is then set to 0, the Error output is set to 1.
Once overflow or underflow no longer occurs after an error, the function block can be set to RUN state
again via ErrAck of the TwinSAFE group. The RESET state is assumed when the ErrAck input of the
corresponding group is 1. When the ErrAck input of the corresponding group changes to 0 again, the
system switches from RESET state to RUN state. In RESET state the AnalogOut output and the Error
output are 0.
Figure 3-72: Function block SUB