3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E F or m o r e i nf o r m a t i o n v i s i t : www. e a t o n. c o m
3-419
API Mnemonic
Operands
Function
171
D GBIN P
S, D
GRAY CODE
→
BIN
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
*
*
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
*
*
GBIN, GBINP: 5 steps
DGBIN, DGBINP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Source GRAY CODE
D
: Destination address for the converted BIN result
Description:
1.
The GRAY CODE value in
S
is converted to an equivalent BIN value and the result is stored in
the device specified by
D
.
2.
This instruction can be used to read the value from an absolute position type encoder (a gray
code encoder) which is connected to the ELC inputs. Convert the value to a BIN value and
store it in the specified register.
3.
If the source is inputs X20~X37, it can speed up the input response time by using the REFF
instruction or D1020 (adjust input response time).
4.
The range of
S
that can be converted to the GRAY CODE is as follows:
16-bit instruction: 0~32,767
32-bit instruction: 0~2,147,483,647
5.
If the GRAY CODE value is outside the range shown above, it is an “Operation Error”.
Program Example:
When X0=ON, the GRAY CODE value in the absolute position type encoder connected to X20~X37
inputs is converted to BIN value and stored in D10.
X0
GBIN
K4X20
D10
0 0 0 1
1
0
1
1
1
0
0 0
b15
b0
H1971=K6513
0 0 0
0
0 0 1
1
1
1
1
1
X37
X20
GRAY6513
K4X20
0 1
0
1
0
0
1
0
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...