Division by zero
This happens when a division operation has a divisor with a value of 0. The result of this operation should be infinite but the UPC of the PLC is unable to process this result. A similar circumstance definitely generates an indefinite result; in the worst case, it also determines a block of the code and UPC (hw) or OS (operating system) level.To avoid these consequences and inform the user of the error, the condition of division by zero is intercepted by specific implementation of the division operations.If the value of the divisor is zero, the running of code 1131 is stopped before the operation is performed.GF Project VX Code reports the block in the PLC status window, as shown below.
To trace the running line responsible for the error it is necessary to be connected via telnet to the target: when the error occurs, a message is shown, indicating the details of the 1131 code line involved (“source” indicating the name of the POU hosting the code and “line” indicating the source line number).
It is possible to immediately reset the running, if the causes that determined the error no longer exist, with the PLC Start command.