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

42 ENCO P Encode<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 DECO, DECOP: 7 steps<br />

S * * * * * * * * *<br />

D * * * * *<br />

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

Operands:<br />

S: Source device to be encoded D: Device for storing the result n: Number of consecutive<br />

bits of S<br />

Explanation:<br />

1. The instruction encodes the lower “2 n ” bits of source S and stores the result in D.<br />

2. They highest active bit in S has the priority for encoding operation.<br />

3. This instruction is generally used in pulse execution mode (ENCOP).<br />

4. When operand S is a bit device, n=1~8, when operand S is a word device, n=1~4<br />

5. If no bits in S is active (1), M1067, M1068 = ON and D1067 records the error code 0E1A<br />

(hex).<br />

Program Example 1:<br />

1. When S is used as a bit device, n = 1 ~ 8. Errors will occur if n = 0 or n > 8.<br />

2. f n = 8, the decoded data is 2 8 = 256 bits data.<br />

3. When X0 goes from OFF to ON, the data in (M0 to M7) will be encoded and stored in lower 3<br />

bits of D0 (b2 to b0). The unused bits in D0 (b15 to b3) will be set to 0.<br />

4. After the execution is completed, X0 is turned OFF and the data in D remains unchanged.<br />

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

X0<br />

ENCOP M0 D0 K3<br />

M7 M6 M5 M4 M3 M2 M1 M0<br />

0 0 0 0 1 0 0 0<br />

7 6 5 4 3 2 1 0<br />

all be 0<br />

4 2<br />

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1<br />

b15<br />

D0<br />

1<br />

1<br />

b0<br />

3-106

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

Saved successfully!

Ooh no, something went wrong!