Chapter 7 Second Development Platform VP3000
370
API Instruction code Operand Function
170 D GRY P S, D
Binary code → Gray code
Type
Operand
Bit devices Word devices
16-bit instruction (5 steps)
GRY
Continuous
execution
type
GRYP
Pulse
execution
type
32-bit instruction (9 steps)
DGRY
ontinuous
execution
type
DGRYP
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
D: device for storing Gray code
Convert the binary value of the device designated by S to Gray code, and store in the device
that D designates.
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 X0 = ON, convert the constant K6513 to Gray code, and store in D0.