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

49 D FLT P Floating Point<br />

Controllers<br />

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

SE<br />

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

Type Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F FLT, FLTP: 5 steps<br />

S * DFLT, DFLTP: 9 steps<br />

D *<br />

PULSE 16-bit 32-bit<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<br />

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

SE<br />

Operands:<br />

S: Source device D: Device for storing the conversion result<br />

Explanations:<br />

1. When M1081 = OFF, the source S is converted from BIN integer to binary floating point value.<br />

At this time, 16-bit instruction FLT occupies 1 register for S and 2 registers for D.<br />

a) If the absolute value of the conversion result > max. floating value, carry flag M1022 = ON.<br />

b) If the absolute value of the conversion result < min. floating value, carry flag M1021 = ON.<br />

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

2. When M1081 is ON, the source S is converted from binary floating point value to BIN integer.<br />

(Decimal ignored). At this time, 16-bit instruction FLT occupies 2 registers for S and 1<br />

register for D. The operation is same as instruction INT.<br />

a) If the conversion result exceeds the available range of BIN integer in D (for 16-bit: -32,768 ~<br />

32,767; for 32-bit: -2,147,483,648 ~ 2,147,483,647), D will obtain the maximum or minimum<br />

value and carry flag M1022 = ON.<br />

b) If the decimal is ignored, borrow flag M1021=ON.<br />

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

d) After the conversion, D stores the result in 16 bits.<br />

Program Example 1:<br />

1. When M1081 = OFF, the BIN integer is converted into binary floating point value.<br />

2. When X20 = ON, D0 is converted to D13, D12 (floating point).<br />

3. When X21 = ON, D1, D0 are converted to D21, D20 (floating point).<br />

4. Assume D0 is K10. When X10 is ON, the converted 32-bit value will be H41200000 and<br />

stored in 32-bit register D12 (D13)<br />

5. If 32-bit register D0 (D1)=K100,000, X21 = ON. 32-bit of floating point after conversion will be<br />

H47C35000 and it will be saved in 32-bit register D20 (D21)<br />

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

SE<br />

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

3-115

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

Saved successfully!

Ooh no, something went wrong!