    KronoTech RSLogix 5000 Ladder Logic Structured Text HMI Search Contact us

# Divide Instruction in Ladder Logic

KronoTech

PLC

Basic

Counters

Timer

Arithmetic

SUB

MUL

DIV

DDV

Comparison

Functions

Trig Functions

RSLogix 5000

Structured Text

HMI

Instruments

>

## DIV - Divide

When rung condition is true, this output instruction divides Source A by Source B and stores the result in the destination and the math register. The value stored in the destination is rounded. The value stored in the math register consists of the unrounded quotient (placed in the most significant word) and the remainder (placed in the least significant word)

#### Example

Equation: N:64 = N7:60 / 2 (13 / 2 = 6.5 )

Notice the result in N7:64 is rounded up to 7).

Source A = N7:60 = 13, Source B = 2, Destination = N7:64 = 7, Notice the result in N7:64 is rounded up to 7). Math Register: The value stored in the math register consists of the unrounded quotient placed in the most significant word (6) and the remainder placed in the least significant (1) #### Example

Equation: F8:62 = f8:50 / F8:61 ( 100.0 / 0.26 = 384.6154). The result is rounded to the closest value.

Source A = F8:60 = 100.00 , Source B = F8:61 = 0.26, Destination = F8:62 = 3846154 #### Example

Equation: N7:63 = N7:62 / F8:63 (100 / 0.9 = 111.111)

Source A = N7:62 = 100 , Source B = F8:63 = 0.9 , Destination = N7:63 = 111 (Rounded) Notice that since N7:63 are an integer it will only hold the quotient part.

#### Note

• Division by zero (0) will generate a minor fault. S:5/0 must be cleared to prevent a major fault.