6. BASIC INSTRUCTIONS
6 − 40
MELSEC-A
DBCD
Converts BIN data (0 to 99999999) of the device specified at S into BCD and
transfers the result to the device specified at D.
Execution Conditions
Operation Errors In the following case, operation error occurs and the error flag turns on.
• When BCD instruction is used
The data of source (S) is outside the range of 0 to 9999.
• When DBCD instruction is used
The data of source (S) is outside the range of 0 to 99999999.
Be sure to set to 0
(Upper 5 bits)
(S) side BIN 99999999
(D) side BCD 99999999
BCD conversion
Ten millions
di
its
(S) (Lower 16 bits)
(S) + 1 (Upper 16 bits)
Millions
di
its
Hundred
thousands
digits
Ten thousands
di
its
Thousands
di
its
Hundreds
di
its
Tens digits
Unit digits
(D) (Lower 4 digits)
(D) + 1 (Upper 4 digits)
OFF
ON
Executed
per scan
Executed
per scan
Executed
only once
Executed
only once
P
BCD conversion command