Division by 0

Question:
Does the Drive PLC / Servo PLC indicate an exceptional error if an division by 0 is executed?

Response:
The indication of an exceptional error depends on the data type used:
  • If integer data types (e. g. INT, DINT, WORD,...) are divided by 0, the result of the division is a random number from the value range of the variable in which the result is stored. The Drive PLC/Servo PLC does not display an exceptional error.
  •  If REAL data types are divided by 0 an exceptional error is indicated.

Recommendation:
The denominator has always to be checked for a 0 before processing a division and, depending on the result, an error message is to be displayed.

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/200412059/1/
Contact form