3. Instruction Set

API

170

Mnemonic

 

Operands

Function

 

 

 

 

 

 

D

GRY

 

P

 

BIN Gray Code

 

 

 

 

 

 

Controllers

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

GRY, GRYP: 5 steps

S

 

 

 

 

*

*

*

*

*

*

*

*

*

*

*

DGRY, DGRYP: 9 steps

D

 

 

 

 

 

 

 

*

*

*

*

*

*

*

*

 

 

 

 

 

 

 

 

 

 

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 D: Operation result (Gray code)

Explanations:

1.GRY instruction converts the BIN value in S to Gray Code and stores the converted result in specified register D.

2.Available range of S:

16-bit instruction: 0~32,767

32-bit instruction: 0~2,147,483,647

3.If operand S exceeds the available range, operation error occurs and M1067 = ON, M1068 = ON. D1067 stores the error code 0E1A (HEX)

4.If operands S and D use device F, only 16-bit instruction is applicable.

Program Example:

When X0 = ON, GRY instruction executes and converts K6513 to Gray Code. The operation result is stored in K4Y20, i.e. Y20 ~ Y37.

 

X0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

GRY

 

 

K6513

 

K4Y20

 

 

b0

 

 

 

 

 

 

 

 

 

 

 

 

 

b15

 

 

 

 

 

 

 

 

 

 

 

 

K6513=H1971

 

 

 

 

 

 

 

 

 

 

 

 

0

0

0

1

1

0 0

1

0

1

1

1

0

0 0

1

 

GRAY 6513

Y37

 

 

 

 

 

 

 

 

 

 

 

 

Y20

 

0

0

0

1

0

1

0

1

1

1

0

0 1

0 0

1

K4Y20

3 - 3 8 9

Page 505
Image 505
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Mnemonic Operands Function, Gry