423
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Conversion Instructions
3
GRY
GRY
Applicable Program Areas
Operands
C: Control Word
Instruction Mnemonic Variations
Function
code
Function
GRAY CODE CONVERT GRY @GRY 474
Converts the gray binary code in a specified word
to standard binary data, BCD data, or an angle at
the specified resolution.
Symbol
GRY
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or transition
programs
Usage OK OK OK OK OK OK
Operand Description Data type Size
C First control word --- 3
S Source word --- 1
D First destination word --- 2
C: First control word
S: Source word
D: First destination word
GRY(474)
C
S
D
C
0
4 3 7 8111215
C+1
C+2
15 1112 0
Do not
use (0).
Operating Mode
0 hex = Gray binary code conversion
Conversion Mode
0 hex = Binary Mode, 1 hex = BCD Mode, 2 hex = 360° Mode
Resolution
0 or 1 to F hex (1 to 15 decimal) bits
0 hex = User specified in bits 12 to 15 of C+2.
Zero Point Compensation (0000 to 7FFF Hex (Binary Data))
Note: Zero point compensation that exceeds the resolution set in the word C of the control
data cannot be specified.
User-specified Resolution
0 hex = 256, 1 hex = 360, 2 hex = 720, 3 hex = 1,024, 4 to F hex = Do not use.
Encoder Remainder Compensation (Binary Data)
Note: The range that can be set depends on the user-specified resolution.
Note: The above setting is valid when the resolution is set to 0 hex in bits 00 to 03 of C.