DIV (divide)
The DIV instruction divides the first Integer or Real input value by the second Integer or Real input value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
DIV

Parameter | Parameter Type | Data Type | Description | |
---|---|---|---|---|
EN | Input | BOOL | When set to true, the instruction is enabled.
| |
i1 | Input | SINT USINT BYTE INT UINT WORD DINT UDINT | DWORD LINT ULINT LWORD REAL LREAL | Dividend in non-zero Integer or Real data type. All inputs must be of the same data type. |
i2 | Input | SINT USINT BYTE INT UINT WORD DINT UDINT | DWORD LINT ULINT LWORD REAL LREAL | Divisor in non-zero Integer or Real data type. All inputs must be of the same data type. |
o1 | Output | SINT USINT BYTE INT UINT WORD DINT UDINT | DWORD LINT ULINT LWORD REAL LREAL | Quotient of the inputs in non-zero Integer or Real data type. Input and output must use the same data type. |
ENO | Output | BOOL | Enables output. Applies to ladder diagram programs. |
DIV examples
DIV function block diagram example

DIV ladder diagram program example

(* ST Equivalence: *) ao10 := ai101 / ai102; ao5 := (ai5 / 2) / ai53;
Provide Feedback