Mitsubishi Electronics FX3G User Manual

Page of 964
582
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
22 External Device – FNC170 to FNC179
22.2 FNC171 – GBIN / Gray Code to Decimal Conversion
22.2
FNC171 – GBIN / Gray Code to Decimal Conversion
Outline
This instruction converts a gray code into a binary value, and transfers it.
1. Instruction format
2. Set data
3. Applicable devices
S
1: This function is supported only in FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 PLCs.
S
2: This function is supported only in FX
3U
/FX
3UC
 PLCs.
Explanation of function and operation
1. 16-bit operation (GBIN and GBINP)
- This instruction can be used for detecting an absolute position by a gray code type encoder.
-  
 can store a value from 0 to 32,767.
2. 32-bit operation (DGBIN and DGBINP)
- A gray code can be converted into a binary value of up to 32 bits.
-
 can store a value from 0 to 2,147,483,647.
Caution
When an input relay (X) is specified as 
, the response relay will be “Scan time of PLC + Input filter constant”.
The input filter value in X000 to X017
*1
 can be converted using the REFF (FNC51) instruction or D8020 (filter
adjustment) so that the delay caused by the filter constant is eliminated.
*1.
X000 to X007 in FX
3G
/FX
3GC
 PLCs
Operand Type
Description
Data Type
Conversion source data or word device storing conversion source data
16- or 32-bit binary
Word device storing data after conversion
16- or 32-bit binary
Oper-
and 
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special 
Unit
Index
Con-
stant
Real 
Number
Charac-
ter String
Pointer
X Y M T C S D .b KnX KnY KnM KnS T C D
R
U \G
V Z Modify K H
E
" "
P
S1
S2
S1
S2
DGBIN
DGBINP
Mnemonic
Operation Condition
P
FNC 171
GBIN
D
16-bit Instruction
 5 steps
GBIN
GBINP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
 9 steps
Continuous
Operation
Pulse (Single)
Operation
  S
  D
  S
  D
BIN 1234
1
1
0
1
1
1
0
1
0
1
1
0
0
1
0
0
1
0
1
1
0
0
1
0
0
0
0
0
b0
b15
X10 X7
X0
GRY 1234
X13
D10
Command
input
This instruction converts and transfers data from
the source (gray code) to the destination (binary).
When           is K3X000 and           is D10
FNC171
GBIN
   
S
   
S
   
S