![FATEK FBs Series Manual Download Page 194](http://html1.mh-extra.com/html/fatek/fbs-series/fbs-series_manual_3764826194.webp)
Advanced Function Instruction
7 -3 0
FUN55
D
P
B
→
G
BINARY - CODE TO GRAY - CODE CONVERSION
FUN55
D
P
B
→
G
S :
EN
Operation control
Ladder symbol
55DP.B G
D :
S
:
Starting of source
D
:
Starting address of destination
S
,
D operand can combine V
、
Z
、
P0~P9 for index
addressing
WX
WY
WM
WS
TMR CTR
HR
IR
OR
SR
ROR
DR
K
XR
Range
Ope-
rand
WX0
∣
WX240
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3840
∣
R3903
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
0~FFFFH
0~FFFFFFFFH
V
、
Z
P0~P9
S
○
○
○
○
○
○
○
○
○
○
○
○
○
○
D
○
○
○
○
○
*
○
○
●
When operation control "EN"=1 or "EN
↑
"(
P
instruction) changes from 0
→
1, it will perform the code conversion; where S
is the source (Binary code), and D is the destination (Gray code) for storing the result.
●
The conversion method shown as below
1
1
0
0
1
0
0
0
1
1
1
0
1
1
0
1
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
XOR
1
1
0
1
0
0
1
0
1
0
0
1
1
0
1
1
Example 1: When M0 changes from 0
→
1, it will perform the 16-bit code conversion
EN
S :
D :
M0
55P.B G
R0
R100
˙
Converting the 16-bit Binary-code in R0 into Gray-code, and
then storing the result into R100.
R0
=
1001010101010011B
Î
R100
=
1101111111111010B