582
FX3S/FX3G/FX3GC/FX3U/FX3UC 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
S1: This function is supported only in FX3G/FX3GC/FX3U/FX3UC PLCs.
S2: This function is supported only in FX3U/FX3UC 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/FX3GC 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
XYMTCSD
.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
110111010110
0100101100100000
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
D
S
S
D
S
S
S