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.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>EX2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

116 D RAD P Degree Radian<br />

Controllers<br />

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

SE<br />

<strong>SX2</strong><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 (degree) D: Conversion result (radian)<br />

Explanation:<br />

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

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

DRAD, DRADP: 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 />

2. Flags: M1020 Zero flag, M1021 Borrow flag, 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 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 degree value of the binary floating point in (D1, D0) to radian and save the<br />

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

X0<br />

DRAD D0 D10<br />

D 1 D 0<br />

Degree value<br />

binary floating point<br />

D11<br />

D10<br />

Radian value (degree x π /180)<br />

binary floating point<br />

3-298

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

Saved successfully!

Ooh no, something went wrong!