6 - 67 6 - 67
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
High Performance
QnA Q4AR
Basic
QCPU
PLC CPU
Process CPU
6.3.7 Conversion from BIN 16 and 32-bit data to Gray code
(GRY, GRYP, DGRY, DGRYP)
Usable Devices
Internal Devices
(System, User)
MELSECNET/10(H)
Direct J
\
Set
Data
Bit Word
File
Register
Bit Word
Special
Function
Module
U
\G
Index
Register
Zn
Constant
K, H
Other
S
D
[Instruction Symbol] [Execution Condition]
indicates GRY or DGRY
Command
Command
GRYP, DGRYP
GRY, DGRY
P
S D
S D
[Set Data]
Set Data Meaning Data Type
S
BIN data, or head number of the device where BIN data is stored BIN 16/32 bits
D
Head number of device to store Gray code after conversion Gray code
[Functions]
GRY
Converts BIN 16-bit data at the device designated by
S
to Gray code, and stores result at device
designated by
D
.
b15
0 BIN 1234 0
0 0 0 1 0 0 1 1 0 1 0 0 10
b0
16 bits
b15
0 Gray code 1234 0
0 0 0 1 1 0 1 0 1 1 1 0 11
b0
D
S
DGRY
Converts BIN 32-bit data at the device designated by
S
to Gray code, and stores result at device
designated by
D
.
0001 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 00
b31 b16 b
b15
0001 1 0 1 1 0 0 1 0 1 1 1 0 0 1 1 1 1 1 0 1 0 1 0 0 0 1 00
b31 b16 b
b15
Gray code 305419896
D
BIN 305419896
S
+1 (upper 16 bits)
S
(lower 16 bits)
S
+1
D
D
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com