DIV

Division of one variable by another of the types: BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL and LREAL.

Example in IL:

LD 8

DIV 2

ST var1

Example in ST:

var1 := 8/2;

Example in FBD:

DIV 1:

DIV 2:

If you define functions in your project with the names CheckDivByte, CheckDivWord, CheckDivDWordand CheckDivReal, 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 functions must have the above listed names.