Clear (clr), Square root (sqr), Updates to arithmetic status bits – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 177: Entering the instruction

Advertising
background image

Chapter 10
Using Math Instructions

10–11

Use the CLR instruction to set the destination to zero. All of the bits reset.
The destination must be a word address.

Updates to Arithmetic Status Bits

With this Bit:

The Controller:

S0/0

Carry (C)

always resets.

S0/1

Overflow (V)

always resets.

S0/2

Zero (Z)

always sets.

S0/3

Sign (S)

always resets.

Entering the Instruction

You enter the instruction from within the program monitor functional area.

P 0 0 0

C L R

D E S T

N 1 1

0

When this instruction is evaluated as true, the square root of the absolute
value of the source is calculated and the rounded integer result is placed in
the destination. The source and the destination must be word addresses.

The instruction calculates 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.

Updates to Arithmetic Status Bits

With this Bit:

The Controller:

S0/0

Carry (C)

sets if the source is negative; otherwise cleared.

S0/1

Overflow (V)

always resets.

S0/2

Zero (Z)

sets when destination value is zero.

S0/3

Sign (S)

always resets.

CLR

CLEAR
Dest

N7:11

0

Execution Times (

µ

sec) when:

True

False

20.80

4.25

Ladder representation:

Clear (CLR)

5

8

FUN

ENT

To enter the function code, press:

SQR

SQUARE ROOT
Source

N7:8

0

Dest

N7:11

0

Execution Times (

µ

sec) when:

True

False

71.25

6.78

Ladder representation:

Square Root (SQR)

Advertising