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>SA2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

18 D BCD P Convert BIN to BCD<br />

Controllers<br />

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

SE <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 BCD, BCDP: 5 steps<br />

S * * * * * * * * * DBCD, DBCDP: 9 steps<br />

D * * * * * * * *<br />

Operands:<br />

S: Source of data D: Conversion result<br />

PULSE 16-bit 32-bit<br />

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

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

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

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <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 />

SE<br />

SE<br />

Explanations:<br />

1. The content in S (BIN value) is converted into BCD value and stored in D<br />

2. As a 16-bit (32-bit) instruction, when the conversion result exceeds the range of 0 ~ 9,999 (0<br />

~ 99,999,999), and M1067, M1068 = ON, D1067 will record the error code 0E18 (hex)<br />

3. If operand S and D use index register F, only 16-bit instruction is available.<br />

4. Flags: M1067 (Program execution error), M1068 (Execution error locked), D1067 (error<br />

code)<br />

Program example:<br />

1. When X0 = ON, the binary value of D10 will be converted into BCD value, and the 1s digit of<br />

the conversion result will be stored in K1Y0 (Y0 ~ Y3, the 4 bit devices).<br />

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

X0<br />

BCD D10 K1Y0<br />

2. If D10=001E (Hex) = 0030 (decimal), the result will be Y0~Y3 = 0000(BIN).<br />

3-72

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

Saved successfully!

Ooh no, something went wrong!