6-93
GBIN(P),DGBIN(P)
1
2
3
4
4
6
7
8
6.3 Data conversion instructions
6.3.10 Conversion of Gray code to BIN 16 and 32-bit data (GBIN(P),DGBIN(P))
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
• Data at when the GBIN instruction was issued is outside the 0 to 32767 range.
(Error code: 4100)
• Data at when the DGBIN instruction was issued is outside the 0 to 2147483647 range.
(Error code: 4100)
Program Example
(1) The following program converts the Gray code data at D100 when X10 is ON to BIN data,
and stores the result at D200.
[Ladder Mode] [List Mode]
(2) The following program converts the Gray code data at D10 and D11 to BIN data when X1C
is ON, and stores the result at D0 and D1.
[Ladder Mode] [List Mode]
S
S
Step
Instruction
Device
Step
Instruction
Device