beautypg.com

Divide (div), Using arithmetic status bits, Math register – Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 284

background image

Chapter 20
Math Instructions

20–8

Divide

DIV

Output Instruction

(DIV)

DIV

DIVIDE
Source A

N7:0
6214

Source B

N7:1

19

Dest

N7:2

327

F1

F2

F3

F4

F5

ZOOM on DIV –(DIV)– 2.3.0.0.2
NAME: DIVIDE
SOURCE A: N7:0 6214
SOURCE B: N7:1 19
DEST: N7:2 327

EDT_DAT

HHT Ladder Display:

HHT Zoom Display:

Ladder Diagrams and APS Displays:

(online monitor mode)

The value at source A is divided by the value at source B with the rounded
quotient being stored in the destination. If the remainder is 0.5 or greater,
round up occurs in the destination. The unrounded quotient is stored in the
most significant word of the math register. The remainder is placed in the
least significant word of the math register.

Using Arithmetic Status Bits

C always reset

V set if division by zero or overflow; otherwise reset. On overflow, the

minor error flag is also set. The value 32,767 is placed in the destination.
Exception: If you are using a Series C or later SLC 5/02 processor and
have the Math Overflow Selection Bit S:2/14 set, then the unsigned,
truncated overflow remains in the destination.

Z set if the result is zero; otherwise reset; undefined if overflow is set

S set if the result is negative; otherwise reset; undefined if overflow is set

Math Register

The unrounded quotient is placed in the most significant word, the remainder
is placed in the least significant word.

Divide (DIV)