beautypg.com

Entering parameters, Using arithmetic status bits, Square root (sqr) – Rockwell Automation 1747-PT1, D1747NP002 Hand-Held Terminal User Manual

Page 296: Slc 5/02 processors only

background image

Chapter 20
Math Instructions

20–20

Entering Parameters

Source – the address that contains the bit decode information. Only the
first four bits (0–3) are used by the DCD instruction. The remaining bits
may be used for other application specific needs. Change the value of the
first four bits of this word to select one bit of the destination word.

Destination – the address of the word to be decoded. Only one bit of this
word is turned on at any one time, depending on the value of the source
word.

Using Arithmetic Status Bits

Unaffected.

SLC 5/02 Processors Only

Square Root

SQR

Output Instruction

(SQR)

SQR

SQUARE ROOT
Source

N7:0

21583

Dest

N7:1

147

F1

F2

F3

F4

F5

ZOOM on SQR –(SQR)– 2.3.0.0.2
NAME: SQUARE ROOT
SOURCE: N7:0 21583
DEST: N7:1 147

EDT_DAT

HHT Ladder Display:

HHT Zoom Display:

Ladder Diagrams and APS Displays:

(online monitor mode)

When this instruction is evaluated as true, the square root of the absolute
value of the source is calculated and the rounded result is placed in the
destination.

The instruction will calculate the square root of a negative number without
overflow or faults. In applications where the source value may be negative,
use a comparison instruction to evaluate the source value to determine if the
destination may be invalid.

Square Root (SQR)