Divide Instruction in Ladder Logic

KronoTech

PLC

Ladder Logic

Basic

Counters

Timer

Arithmetic

ADD

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).

Ladder Logic Solution

Source A = N7:60 = 13, Source B = 2, Destination = N7:64 = 7, Notice the result in N7:64 is rounded up to 7).

DIV - SLC 500 Beginners Guide

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)

DIV - SLC 500 Beginners Guide

Example

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

Ladder Logic Solution

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

DIV - SLC 500 Beginners Guide

Example

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

Ladder Logic Solution

Source A = N7:62 = 100 , Source B = F8:63 = 0.9 , Destination = N7:63 = 111 (Rounded)

DIV - SLC 500 Beginners Guide

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.

Quick Links

PLC Languages

Ladder Logic
Function Block
Structure Text
SFC
Mnemonic

Ladder Logic

Basic
Counters
Timer
Arithmetic
Comparison
Functions
Trig Functions

Instruments

Switches

HMI

Advantages
Alarms
Trends

Other

Bottle Application