3. Instruction Set

API

127

Mnemonic

 

Operands

Function

 

 

 

 

 

 

D

ESQR

 

P

 

Floating point square root

 

 

 

 

 

 

Controllers

ES2/EX2 SS2 SA2 SX2

SE

Type

Bit Devices

 

Word devices

 

 

 

 

Program Steps

OP

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F

DESQR, DESQRP: 9

S

 

 

 

 

*

*

 

*

 

 

steps

D

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

PULSE

 

 

16-bit

 

32-bit

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

SE

SE

SE

Operands:

S: Source device D: Operation result

Explanations:

1.This instruction performs a square root operation on the floating point value in S and stores the result in D. All data will be operated in binary floating point format and the result will also be stored in floating point format.

2.If the source device S is specified as constant K or H, the integer value will automatically be converted to binary floating value.

3.If operation result of D is 0 (zero), 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 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), M1068 (Execution Error Locked)

Program Example 1:

When X0 = ON, the square root of binary floating point (D1, D0) is stored in (D11, D10) after the operation of square root.

 

 

X0

DESQR

D0

D10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(D11, D10)

 

 

 

 

 

 

 

 

 

(D1, D0)

 

 

 

 

 

 

 

 

 

 

Binary floating point

Binary floating point

Program Example 2:

When X2 = ON, the square root of K1234 (automatically converted to binary floating value) is stored in (D11, D10).

X2

DESQR K1234 D10

3 - 3 11

Page 427
Image 427
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Esqr, DESQR, Desqrp