FX Series Programmable Controlers Applied Instructions 5
5-22
5.2.9 BCD (FNC18)
Operation 1:
(Applicable to all units)
The binar
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
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
to a seven se
ment displa
.
Operation 2:
(Applicable units: FX
(2C)
)
This function is equivalent to FNC 118 EBCD Data
(S)is converted from ‘floatin
point’ format to
‘scientific format’ (D). This instruction requires
double word (32 bit) operation and data re
isters as
devices (S)and (D)to operate correctl
.
5.2.10 BIN (FNC 19)
Operation 1:
(Applicable to all units)
The BCD source data (S) is converted into an
equivalent binar
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
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
point’ format (D). This instruction requires double
word (32 bit) operation and data re
isters as
devices (S)and (D)to operate correctl
.
Mnemonic Function
Operands
Program steps
SD
BCD
FNC 18
(
Binar
coded
decimal)
Converts binar
numbers to BCD
equivalents /
Converts floatin
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
M8023 to convert data to scientific for-
mat, onl
double word (32 bit) data re
isters (D) ma
be used. See pa
e 4-46 for more details re
ardin
floatin
point format.
Mnemonic Function
Operands
Program steps
SD
BIN
FNC 19
(Binar
)
Converts BCD
numbers to their
binar
equivalent /
Converts scientific
format data to float-
in
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
M8023 to convert data to floatin
point format, onl
double word (32 bit) data re
-
isters (D) ma
be used. See pa
e 4-46 for more
details re
ardin
floatin
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 ]