CheckDivDWord : DWORD
If you define functions in your project with the name CheckDivDWord, you can use them to check the value of the divisor if you use the operator DIV, for example to avoid a division by 0. The name of the function is defined and may have only this identifier.
![]() | The function can cause a significant increase in system load, so it should only be used for testing purposes. |
VAR_INPUT
divisor : DWORD;
END_VAR
Example of CheckDivDWord implementation:
IF divisor = 0 THEN
CheckDivDWord := 1;
ELSE
CheckDivDWord := divisor;
END_IF