2 Instruction Descriptions
2-382
NJ-series Instructions Reference Manual (W502)
The data type of Resolution is enumerated type _eGRY_RESOLUTION. The meaning of the enumera-
tors are as follows:
The following example is for when In is WORD#16#1A9, Resolution is _R10B, ERC is UINT#0, and
ZPC is UINT#337. The value of Out will be LREAL#348.75.
Enumerator Meaning
_R256 256
_R1B 1-bit (2)
_R2B 2-bit (4)
_R3B 3-bit (8)
_R4B 4-bit (16)
_R5B 5-bit (32)
_R6B 6-bit (64)
_R7B 7-bit (128)
_R8B 8-bit (256)
_R9B 9-bit (512)
_R10B 10-bit (1024)
_R11B 11-bit (2048)
_R12B 12-bit (4096)
_R13B 13-bit (8192)
_R14B 14-bit (16384)
_R15B 15-bit (32768)
_R360 360
_R720 720
_R1024 1024
abc:=Gray(WORD#16#1A9, _R10B, UINT#0, UINT#337);
LD ST
abc
_R10B
WORD#16#1A9
UINT# 0
UINT#337
Gray
EN ENO
In
Resolution
ERC
ZPC
In
Out = abc
Gray code is converted to binary.
16#01A9 → 16#0131(10#305)
Correction (Subtract ERC and ZPC.)
305 − 0 − 337 → −32
Converted to an angle
−32 × 360 ÷ 2
10
→ −11.25
360 − 11.25 → 348.75
Bit
0
Bit
15
0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1
LREAL#348.75