DIV Divide

Also called: division, quotient, ÷

OUT := IN1 / IN2; division by zero: ENO = 0.

What it does

The DIV block divides the first value by the second and writes the quotient into OUT.

When to use it

For an average, scaling, a flow rate (quantity / time).

Operands

European mnemonicAmerican mnemonicNameData typeDirectionRequiredMeaning
ENENEnableBOOLInputYesRung condition: the computation runs only when power flow is 1.
IN1IN1Source AINT, DINT, REALInputYesFirst operand.
IN2IN2Source BINT, DINT, REALInputYesSecond operand.
OUTOUTDestinationINT, DINT, REALOutputNoResult (variable). Not changed while the rung is 0.
ENOENOEnable outBOOLOutputNo0 on division by zero (OUT is not changed).
MnemonicNameData typeDirectionRequiredMeaning
ENEnableBOOLInputYesRung condition: the computation runs only when power flow is 1.
IN1Source AINT, DINT, REALInputYesFirst operand.
IN2Source BINT, DINT, REALInputYesSecond operand.
OUTDestinationINT, DINT, REALOutputNoResult (variable). Not changed while the rung is 0.
ENOEnable outBOOLOutputNo0 on division by zero (OUT is not changed).
MnemonicNameData typeDirectionRequiredMeaning
ENEnableBOOLInputYesRung condition: the computation runs only when power flow is 1.
IN1Source AINT, DINT, REALInputYesFirst operand.
IN2Source BINT, DINT, REALInputYesSecond operand.
OUTDestinationINT, DINT, REALOutputNoResult (variable). Not changed while the rung is 0.
ENOEnable outBOOLOutputNo0 on division by zero (OUT is not changed).

Example

European style
American style

When S1 is 1, V3 := V1 / V2.

Try it in the simulatorThe example opens in the free simulator; your own program stays as it was.

Behaviour in detail

See also