beautypg.com

Negate (neg), Using arithmetic status bits – Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 286

background image

Chapter 20
Math Instructions

20–10

NEG

NEGATE
Source

N7:0

98

Dest

N7:1

–98

Negate

NEG

Output Instruction

(NEG)

F1

F2

F3

F4

F5

ZOOM on NEG –(NEG)– 2.3.0.0.2
NAME: NEGATE
SOURCE: N7:0 98
DEST: N7:1 –98

EDT_DAT

HHT Ladder Display:

HHT Zoom Display:

Ladder Diagrams and APS Displays:

(online monitor mode)

The source value is subtracted from 0 and then stored in the destination.
(The destination contains the 2’s complement of the source.)

Using Arithmetic Status Bits

C cleared if 0 or overflow, otherwise set.

V set if 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.

S set if the result is negative; otherwise reset.

Math Register

Unchanged.

Negate (NEG)