How can an overflow of arithmetic operations in the fail-safe program be intercepted?
In order to intercept a possible overflow of an arithmetic operation in the fail-safe program and to avoid the resulting change of operation mode to Stop, several functions for the arithmetic operations addition, subtraction, multiplication and division were developed.
These functions evaluate in the fail-safe program if the result of the arithmetic operation will be located outside the permitted range for this data type. If that's the case, the arithmetic operation will not be executed and an output will be set to signal the avoided overflow. Otherwise the arithmetic operation will be executed and the result will be output.
|0||1||Overflow detected. Arithmetic operation was not executed.|
|Result||0||Arithmetic operation was executed succesfully.|
For each of these arithmetic operations two functions are available: one for the data type Integer and one for the data type Double Integer. The following figure shows the four functions for the data type Integer.
STEP 7 Professional V13 SP1
STEP 7 Safety Basic/Advanced V13 SP1
SIMATIC S7-1200 or S7-1500