FX Series Programmable Controlers Applied Instructions 5
5-26
5.2.9 BCD (FNC18)
Operation: (Applicable to all units)
The binary 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 ranges 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 directly to a seven segment
display.
Mnemonic Function
Operands
Program steps
SD
BCD
FNC 18
(
Binarycoded
decimal)
Converts binary
numbers to BCD
equivalents /
Converts floating
point data to
scientific format
KnX,KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z
BCD, BCDP:
5steps
DBCD,
DBCDP:
9steps
When using M8023 to convert data to scientific for-
mat, only double word (32 bit) data registers (D) may
be used. See page 4-46 for more details regarding
floating point format.
FX1S
FX
1N
FX
2N
FX
2NC
PULSE-P
16 BIT OPERATION
32 BIT OPERATION
X0
BCD D 12 K2Y0
[ S ] [ D ]
X30
M8023
M8000
M8023
DBCD
D 42
D 20
[ S ] [ D ]