M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.3 Data Conversion Instructions
8.3 Data Conversion Instructions
BCD, BCDP, DBCD, DBCDP: Conversion from BIN data to 4-digit and 8-digit BCD
Setting
Bit devices
data
X
Y
M
L
F
S
○
○
○
○
○
D
○
○
○
○
○
△ : This is not available with DBCD (P).
[Instruction symbol] [Execution condition]
BCD, DBCD
BCDP, DBCDP
Setting data
Setting data
S
Head No. of the device where BIN data is stored
D
Head No. of the device that will store BCD data
Functions
BCD
Converts BIN data (0 to 9999) at the device designated by "D" to BCD data, and stores it at the device designated by "D".
3276816384 8192 4096 2048 1024 512
0 0 1 0 0 1 1 1 0 0 0 0 1
S BIN 9999
8000 4000 2000 1000 800
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
D BCD 9999
Thousands
digits
DBCD
Converts BIN data (0 to 99999999) at the device designated by "S" to BCD data, and transfers it at the device designated
by "D".
0 0 0 0 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1
S
BIN
99999999
Always set these to 0(Upper 5 bits)
D
BCD
99999999
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Ten
millions
digits
IB-1501667-B
Usable devices
B SB
T SM V
T
C
○
○
○
○
○
○
○
○
○
○
Command
Command
Meaning
256
128
64
Always set these to 0
400
200
100
80
40
Hundreds
Tens
digits
digits
S+1(Upper 16 bits)
Millions
Hundred
Ten
digits
thousands
thousands
digits
digits
D+1(Upper 4 digits)
Word devices
D
R/ZR W SW SD
Z
○
○
○
○
○
△
○
○
○
○
○
△
32
16
8
4
2
1
1 1 1
BCD conversions
20
10
8
4
2
1
Ones
digits
S (Lower 16 bits)
BCD conversions
Thousands
Hundreds
Tens
digits
digits
digits
D (Lower 4 digits)
214
Digit
Con-
Pointer
designa-
Index
stant
tion
K
H
P
○
indicates the signs BCD/DBCD
S
D
P
S
D
Data type
BIN 16/32 bits
BCD 4/8 digits
Ones
digits
○