FX Series Programmable Controlers Applied Instructions 5
5-22
5.2.9 BCD (FNC18)
Operation 1:
(Applicable to all units)
The binar
y
source data (S) is converted into an
equivalent BCD number and stored at the
destination device (D). If the converted BCD number
exceeds the operational ran
g
es of 0 to 9,999 (16 bit
operation) and 0 to 99,999,999 (32 bit operation) an error will occur.This instruction can be
used to output data directl
y
to a seven se
g
ment displa
y
.
Operation 2:
(Applicable units: FX
(2C)
)
This function is equivalent to FNC 118 EBCD Data
(S)is converted from ‘floatin
g
point’ format to
‘scientific format’ (D). This instruction requires
double word (32 bit) operation and data re
g
isters as
devices (S)and (D)to operate correctl
y
.
5.2.10 BIN (FNC 19)
Operation 1:
(Applicable to all units)
The BCD source data (S) is converted into an
equivalent binar
y
number and stored at the
destination device (D). If the source data is not
provided in a BCD format an error will occur. This instruction can be used to read in data
directl
y
from thumbwheel switches.
Operation 2:
(Applicable units: FX
(2C)
)
This function is equivalent to FNC 119 EBIN Data
(S) is converted from ‘scientific format’ to ‘floatin
g
point’ format (D). This instruction requires double
word (32 bit) operation and data re
g
isters as
devices (S)and (D)to operate correctl
y
.
Mnemonic Function
Operands
Program steps
SD
BCD
FNC 18
(
Binar
y
coded
decimal)
Converts binar
y
numbers to BCD
equivalents /
Converts floatin
g
point data to
scientific format
KnX,KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z
BCD, BCDP:
5 steps
DBCD,
DBCDP:
9 steps
When usin
g
M8023 to convert data to scientific for-
mat, onl
y
double word (32 bit) data re
g
isters (D) ma
y
be used. See pa
g
e 4-46 for more details re
g
ardin
g
floatin
g
point format.
Mnemonic Function
Operands
Program steps
SD
BIN
FNC 19
(Binar
y
)
Converts BCD
numbers to their
binar
y
equivalent /
Converts scientific
format data to float-
in
g
point format
KnX, KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z
BIN, BINP:
5 steps
DBIN, DBINP:
9 steps
When usin
g
M8023 to convert data to floatin
g
point format, onl
y
double word (32 bit) data re
g
-
isters (D) ma
y
be used. See pa
g
e 4-46 for more
details re
g
ardin
g
floatin
g
point format.
X0
BCD D 12 K2Y0
[ S ] [ D ]
X30
M8023
M8000
M8023
DBCD
D 42
D 20
[ S ] [ D ]
X0
BIN D 13K2X0
[ S ] [ D ]
X10
M8023
M8000
M8023
DBIN
D 12
D 10
[ S ] [ D ]