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

API

Mnemonic

Operands

Function

Controllers

171

D

GBIN

P

 

 

 

 

 

Gray Code BIN

 

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

GBIN, GBINP: 5 steps

 

S

 

 

 

 

*

*

*

*

*

*

*

*

*

*

*

DGBIN, DGBINP: 9

 

 

D

 

 

 

 

 

 

 

*

*

*

*

*

*

*

*

steps

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

16-bit

 

 

 

32-bit

 

 

 

 

 

 

 

 

 

 

 

 

SA2

 

 

 

 

SA2

 

SA2

 

 

 

 

 

 

 

 

 

ES2/EX2 SS2

SE

SX2 ES2/EX2 SS2

SE

 

SX2 ES2/EX2 SS2 SE

SX2

Operands:

S: Source device D: Operation result (BIN value)

Explanations:

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

2.This instruction can be used to read the value from an absolute position type encoder (generally a Gray Code encoder) which is connected to the PLC inputs. The Gray code is converted to BIN value and stored in the specified register.

3.Available range of S:

16-bit instruction 0~32,767

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

4.If operand S exceeds the available range, operation error occurs and the instruction is disabled.

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

Program Example:

When X20 = ON, the Gray Code value in the absolute position type encoder connected to X0~X17 inputs is converted to BIN value and stored in D10.

X20

GBIN K4X0

D10

X17

K4X0

X0

 

GRAY CODE 6513 0 0 0 1 0 1 0 1 1 1 0 0 1 0 0 1

b15

b0

H1971=K6513 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1

3 - 390

Page 506
Image 506
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Gbin, DGBIN, Dgbinp