17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

127 D ESQR P Floating point square root<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong> <strong>SX2</strong><br />

SE<br />

Type<br />

Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F<br />

S * * *<br />

D *<br />

Operands:<br />

S: Source device D: <strong>Operation</strong> result<br />

DESQR, DESQRP: 9<br />

steps<br />

PULSE 16-bit 32-bit<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE SE SE <strong>SX2</strong><br />

Explanations:<br />

1. This instruction performs a square root operation on the floating point value in S and stores the<br />

result in D. All data will be operated in binary floating point format and the result will also be<br />

stored in floating point format.<br />

2. If the source device S is specified as constant K or H, the integer value will automatically be<br />

converted to binary floating value.<br />

3. If operation result of D is 0 (zero), Zero flag M1020 = ON.<br />

4. S can only be a positive value. Performing any square root operation on a negative value will<br />

result in an “operation error” and instruction will not be executed. M1067 and M1068 = ON and<br />

error code “0E1B” will be recorded in D1067.<br />

5. Flags: M1020 (Zero flag), M1067 (Program execution error), M1068 (Execution Error Locked)<br />

Program Example 1:<br />

When X0 = ON, the square root of binary floating point (D1, D0) is stored in (D11, D10) after the<br />

operation of square root.<br />

X0<br />

DESQR<br />

D0<br />

D10<br />

(D1, D0) (D11,<br />

D10)<br />

Binary floating point Binary floating point<br />

Program Example 2:<br />

When X2 = ON, the square root of K1234 (automatically converted to binary floating value) is stored<br />

in (D11, D10).<br />

X2<br />

DESQR K1234 D10<br />

3-311

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!