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.

<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 />

129 D INT P Float to integer<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 D: <strong>Operation</strong> result<br />

INT, INTP: 5 steps<br />

DINT, DINTP: 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 />

Explanations:<br />

1. The binary floating point value in the register S is converted to BIN integer and stored in<br />

register D. The decimal of the operation result will be left out.<br />

2. This instruction is the opposite of the API 49 (FLT) instruction.<br />

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

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

If there is any decimal left out, borrow flag M1021 = ON.<br />

If the conversion result is larger than the below range, carry flag M1022 = ON<br />

16-bit instruction: -32,768 ~ 32,767<br />

32-bit instruction: -2,147,483,648 ~ 2,147,483,647<br />

Program Example:<br />

1. When X0 = ON, the binary floating point value of (D1, D0) will be converted to BIN integer and<br />

the result is stored in D10. The decimal of the result will be left out.<br />

2. When X1 = ON, the binary floating point value of (D21, D20) will be converted to BIN integer<br />

and the result is stored in (D31, D30). The decimal of the result will be left out.<br />

X0<br />

INT<br />

D0<br />

D10<br />

X1<br />

DINT<br />

D20<br />

D30<br />

3-314

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

Saved successfully!

Ooh no, something went wrong!