8 Applied Instructions (Move and Compare)
8.10 BIN / Conversion to Binary
166
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Program examples
1. When the digital switch has 1 digit
2. When the digital switch has 2 to 4 digits
3. When the digital switch has 5 to 8 digits
MOV instruction can be used instead.
X000
D0
BIN
EN
s
ENO
d
K1X000
D0
X000
MOV
EN
s
ENO
d
K1X000
PLC
6
[Structured ladder/FBD]
[ ST ]
BIN(X000, K1X000, D0);
[Structured ladder/FBD]
[ ST ]
MOV (X000, K1X000, D0);
[Structured ladder/FBD]
[ ST ]
BIN (X000, K2X000, D0);
PLC
K4 K3 K2 K1
9786
X000
BIN
EN
s
ENO
d
K2X000
Digital switch input
D0
Output destination
In the case of 2 digits: K2
In the case of 3 digits: K3
In the case of 4 digits: K4
PLC
97865342
K4 K3 K2 K1K8 K7 K6 K5
X000
D0
DBIN
EN
s
ENO
d
K5X000
[Structured ladder/FBD]
[ ST ]
DBIN (X000, K5X000, D0);
Digital switch input
Output
destination
In the case of 5 digits: K5
In the case of 6 digits: K6
In the case of 7 digits: K7
In the case of 8 digits: K8