Data Conversion Instructions; Conversion From Bin Data To 4-Digit And 8-Digit Bcd (Bcd(P), Dbcd(P)) - Mitsubishi MELSEC QS Series Programming Manual

Hide thumbs Also See for MELSEC QS Series:
Table of Contents

Advertisement

BCD(P), DBCD(P)
6.3

Data Conversion Instructions

6.3.1
Conversion from BIN data to 4-digit and 8-digit BCD
(BCD(P), DBCD(P))
BCD(P), DBCD(P)
BCD(P), DBCD(P)
BCD, DBCD
BCDP, DBCDP
Function
BCD
(1) Converts BIN data (0 to 9999) at the device designated by
the device designated by
DBCD
(1) Converts BIN data (0 to 99999999) at the device designated by
it at the device designated by
6-22
6.3 Data Conversion Instructions

6.3.1 Conversion from BIN data to 4-digit and 8-digit BCD (BCD(P), DBCD(P))

Command
Command
: BIN data or start number of the devices where the BIN data is stored (BIN 16/32 bits)
D
: Start number of the devices where BCD data will be stored (BCD 4/8 digits)
Internal Devices
Set
Data
Bit
Word
D
.
D
−32768
16384
8192
4096
2048
S
BIN 9999
0
0
1
0
0
Always filled with 0.
8000
4000
2000
1000
800
D
BCD 9999
1
0
0
1
1
Thousands digit
Hundreds digit
D
S +1 (Upper 16 digits)
S
BIN 99999999
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
Always filled with 0 (Upper 5 digits)
1
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
D
BCD 99999999
0
Ten millions
Millions
digit
digit
D +1 (Upper 4 digits)
Constants
Others
K, H
––
––
––
1024
512
256
128
64
32
16
1
1
1
0
0
0
0
BCD conversion
400
200
100
80
40
20
10
0
0
1
1
0
0
1
Tens digit
.
S (Lower 16 digits)
BCD conversion
Ten thousands
Thousands
Hundred
digit
digit
thousands
digit
D (Lower 4 digits)
indicates "BCD / DBCD".
S
D
P
S
D
to BCD data, and stores it at
8
4
2
1
1
1
1
1
8
4
2
1
1
0
0
1
Ones digit
to BCD data, and stores
Hundreds
Tens
Ones
digit
digit
digit

Advertisement

Table of Contents
loading

Table of Contents