DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

API

42

Mnemonic

Operands

Function

Controllers

ENCO

P

Encode

ES2/EX2

SS2

SA2

SX2

SE

Type

 

Bit Devices

 

 

 

 

 

Word devices

 

 

 

 

 

 

Program Steps

 

OP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X

Y

M

S

K

 

H

KnX

KnY

KnM

KnS

T

C

D

E

F

DECO, DECOP: 7 steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S

 

*

*

*

*

 

 

 

 

 

 

 

 

 

 

*

*

*

 

*

*

 

 

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*

*

*

 

*

*

 

 

 

 

 

 

 

n

 

 

 

 

 

 

*

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

16-bit

 

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

ES2/EX2

SS2

 

SA2

SX2

ES2/EX2

SS2

 

SA2

SX2

ES2/EX2

SS2

 

SA2

 

SX2

 

 

 

 

 

 

 

SE

 

SE

 

SE

 

Operands:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S: Source device to be encoded

 

D: Device for storing the result

n: Number of consecutive

 

bits of S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Explanation:

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

2.They highest active bit in S has the priority for encoding operation.

3.This instruction is generally used in pulse execution mode (ENCOP).

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

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

Program Example 1:

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

2.f n = 8, the decoded data is 28= 256 bits data.

3.When X0 goes from OFF to ON, the data in (M0 to M7) will be encoded and stored in lower 3 bits of D0 (b2 to b0). The unused bits in D0 (b15 to b3) will be set to 0.

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

 

X0

 

 

 

 

ENCOP

 

M0

 

D0

 

 

K3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M7

 

M6

M5

 

M4

M3

M2

M1

M0

 

 

 

0

 

 

 

0

 

0

 

 

0

 

1

 

0

0

 

 

0

 

7

 

 

 

6

 

5

 

 

4

 

3

 

2

1

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

all be 0

 

 

 

 

 

4

2

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

 

 

b15

 

 

 

 

 

 

 

D0

 

 

 

 

 

 

b0

3 - 106

Page 222
Image 222
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual All be B15