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

19 D BIN P Convert BCD to BIN<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 BIN, BINP: 5 steps<br />

S * * * * * * * * * DBIN, DBINP: 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 of data D: Conversion result<br />

Explanations:<br />

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

2. The valid range of source S: BCD (0 to 9,999), DBCD (0 to 99,999,999)<br />

3. If the content of S is not a valid BCD value, an operation error will occur, error flags M1067<br />

and M1068 = ON, and D1067 holds error code H0E18.<br />

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

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

code)<br />

Program example:<br />

When X0 = ON, the BCD value of K1M0 will be converted to BIN value and stored in D10.<br />

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

SE<br />

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

X0<br />

BIN<br />

K1X20<br />

D10<br />

Points to note:<br />

1. When PLC needs to read an external DIP switch in BCD format, BIN instruction has to be<br />

first adopted to convert the read data into BIN value and store the data in PLC.<br />

2. On the contrary when PLC needs to display a value on a BCD format 7-segment displayer,<br />

BCD instruction is required to convert the internal data into BCD value then sent the value to<br />

the displayer.<br />

3. When X0 = ON, the BCD value of K4X20 is converted into BIN value and sent to D100. The<br />

BIN value of D100 will then be converted into BCD value and sent to K4Y20.<br />

X0<br />

BIN<br />

K4X20<br />

D100<br />

BCD D100 K4Y20<br />

3-73

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

Saved successfully!

Ooh no, something went wrong!