beautypg.com

Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 219

background image

Chapter 15
Instruction Set Overview

15–5

Math Instructions – Chapter 20

Instruction Name

and Mnemonic

5/02

Only

Function – Output Instructions

Add

ADD

When rung conditions are true, the ADD instruction
adds source A to source B and stores the result in the
destination.

Subtract

SUB

When rung conditions are true, the SUB instruction
subtracts source B from source A and stores the result
in the destination.

Multiply

MUL

When rung conditions are true, the MUL instruction
multiplies source A by source B and stores the result in
the destination.

Divide

DIV

When rung conditions are true, the DIV instruction
divides source A by source B and stores the result in
the destination and the math register.

Double Divide

DDV

When rung conditions are true, the DDV instruction
divides the contents of the math register by the source
and stores the result in the destination and the math
register.

Negate

NEG

When rung conditions are true, the NEG instruction
subtracts the source from zero and stores the result in
the destination.

Clear

CLR

When rung conditions are true, the CLR instruction
clears the destination to zero.

Convert to BCD

TOD

When rung conditions are true, the TOD instruction
converts the source value to BCD and stores it in the
math register or the destination file of the SLC 5/02.

Convert from BCD

FRD

When rung conditions are true, the FRD instruction
converts a BCD value in the math register or the source
file of the SLC 5/02 to an integer, and stores it in the
destination.

Decode

DCD

When rung conditions are true, the DCD instruction
decodes 4-bit value (0 to 16), turning on the
corresponding bit in 16-bit destination.

Square Root

SQR

When rung conditions are true, the SQR instruction
calculates the square root of the source and places the
rounded result in the destination.

Scale

SCL

When rung conditions are true, the SCL instruction
multiplies the source by a specified rate. The result is
added to an offset value and placed in the destination.