Publication 1762-RM001C-EN-P
Math Instructions 10-9
SQR - Square Root
Instruction Type: output
The SQR instruction calculates the square root of the absolute value of the
source and places the rounded result in the destination.
The data ranges for the source is -32768 to 32767 (word) and
-2,147,483,648 to 2,147,483,647 (long word). The Carry Math Status Bit is
set if the source is negative. See Updates to Math Status Bits on page 10-3
for more information.
SQR
Square Root
Source N7:0
0<
Dest N7:1
0<
SQR
Table 10.11 Execution Time for the SQR Instruction
Controller Data Size When Rung Is:
True False
MicroLogix 1200 word 26.0
µ
s0.0
µ
s
long word 30.9
µ
s0.0
µ
s
MicroLogix 1500 word 22.3
µ
s0.0
µ
s
long word 26.0
µ
s0.0
µ
s
Table 10.12 SQR Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page4-2.
Parameter
Data Files Function Files
CS - Comms
IOS - I/O
Address
Mode
(1)
(1) See Important note about indirect addressing.
Address
Level
O
I
S
B
T, C, R
N
ST
L
MG, PD
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
DAT
TPI
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
Source •• ••• • • • •••
Destination •• ••• •
• •••
IMPORTANT
You cannot use indirect addressing with: S, ST, MG, PD,
RTC, HSC, PTO, PWM, STI, EII, BHI, MMI, DAT, TPI, CS,
IOS, and DLS files.