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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

117 D DEG P Radian Degree<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 (radian) D: Conversion result (degree)<br />

Explanation<br />

1. Use the following formula to convert radian to degree:<br />

Degree = Radian × (180/π)<br />

DDEG, DDEGP: 9 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 />

Flags: M1020 Zero flag, M1021 Borrow flag and M1022 Carry flag.<br />

If the absolute value of the result exceeds the max. floating point value, carry flag M1022 = ON.<br />

If the absolute value of the result is less than the min. floating point value, borrow flag M1021 = ON.<br />

If the conversion result is 0, zero flag M1020 = ON.<br />

Program Example:<br />

When X0 = ON, convert the radian of the binary floating point in (D1, D0) to degree and save the<br />

binary floating point result in (D11, D10).<br />

X0<br />

DDEG D0 D10<br />

D 1 D 0<br />

Radian value<br />

binary floating point<br />

D 11 D 10<br />

Degree value (radian x 180/ π)<br />

binary floating point<br />

3-299

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

Saved successfully!

Ooh no, something went wrong!