3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E F o r m o r e i n f o r m a t i o n v i s i t :
w w w. e a t o n . c o m
3 - 3 11
API Mnemonic
Operands
Function
127
D ESQR P
S, D
Floating point Square Root
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C
D
E
F
S
*
*
*
D
*
DESQR, DESQRP: 9
steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32
16
P
32
16
P
32
16
P
32 16
P
32
16
P
Operands:
S
: Source address
D
: Destination address to store the result
Description:
1.
This instruction performs a square root operation on the floating point value of source
S
and
stores the result at the destination
D
. All operations are performed in the floating point format
and the result will also be stored in floating point format.
2.
If the source
S
is a constant K or H, the integer value will automatically be converted to binary
floating point to perform the ESQR operation.
3.
If the ESQR operation result in
D
is 0 (zero), the Zero flag M1020= ON.
4.
S
can only be a positive value. Performing any square root operation on a negative value will
result in an “operation error” and this instruction will not be executed. M1067 and M1068 = ON
and error code “0E1B” will be recorded in D1067.
5.
Flags: M1020 (Zero flag), M1067 (Program execution error)
Program Example 1:
When X0= ON, the square root of binary floating point value in (D1, D0) is stored in register (D11,
D10) in binary floating point.
D0
DESQR
X0
D10
(D1, D0) (D11 D10)
,
Binary floating point
Binary floating point
Program Example 2
When X2= ON, the square root of K1234 (automatically converted to binary floating point) is stored
in (D11, D10).
K1234
DESQR
X2
D10
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...