Chapter 7 Second Development PlatformVP3000
371
API Instruction code Operand Function
171 D GBIN P S, D
Gray code → Binary code
Type
Operand
Bit devices Word devices
16-bit instruction (5 steps)
GBIN
Continuous
execution
type
GBINP
Pulse
execution
type
32-bit instruction (9 steps)
DGBIN
ontinuous
execution
type
DGBINP
Pulse
execution
type
Associated flag: none
X Y M K H KnX KnY KnM T C D
S
D
Caution for using operand
See the specification of each model for the scope of device’s usage.
Description
S: source device for storing Gray code
D: device for storing the binary value
Convert the content (Gray code) of the device designated by S to binary value, and store in
the device that D designates.
This instruction is to convert the content of the absolute position type encoder (the output
value is generally Gray code) which connects with input side of PLC to be binary value, and
store in the designated register.
The available range of S is as below. If the value exceeds the range, it’s operation error, and
the instruction is not executed.
16-bit instruction: 0–32,767
32-bit instruction: 0–2,147,483,647
Example
When X20 = ON, convert the Gray code from the absolute position encoder which connects
with X0–X17 input side to be binary value, and store in D10.
X20
GBIN K4X0 D10
0001 10111000
b15
b0
H1971=K6513
000 0 00111111
X17 X0
GRAY CODE 6513
K4X0
01 0 1
0010