Data Conversion Instructions; Data Conversion Instructions; Conversion From Bin Data To Bcd 4-Digit Data, Conversion From Bin Data To Bcd 8-Digit Data - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

6.3

Data Conversion Instructions

Conversion from BIN data to BCD 4-digit data, conversion from
BIN data to BCD 8-digit data
BCD(P), DBCD(P)
High
Basic
Process
Redundant Universal
performance
BCD, DBCD
BCDP, DBCDP
(S): BIN data or head number of the devices where the BIN data is stored (BIN 16/32 bits)
(D): Head number of the devices where BCD data will be stored (BCD 4/8 digits)
Setting
Internal device
data
Bit
Word
(S)
(D)
Processing details
■BCD
• Converts BIN data (0 to 9999) at the device designated by (S) to BCD data, and stores it at the device designated by (D).
-32768
16384
8192
4096
S
BIN 9999
0
0
1
0
Must always be "0".
8000
4000
2000
1000
D
BCD 9999
1
0
0
1
Thousands digits Hundreds digits
■DBCD
• Converts BIN data (0 to 99999999) at the device designated by (S) to BCD data, and stores it at the device designated by
(D).
S
+1 (Upper 16 bits)
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
Must always be "0" (upper 5 digits).
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
D
BCD 99999999
Ten
Millions
millions
digits
digits
LCPU
Command
Command
R, ZR
J\
Bit
2048
1024
512
256
128
64
32
0
1
1
1
0
0
0
BCD conversion
800
400
200
100
80
40
20
1
0
0
1
1
0
0
Tens digits
BCD conversion
Hundred
Ten
Thousands
thousands
thousands
digits
digits
digits
D
+1 (Upper 4 digits)
indicates an instruction symbol of
P
U\G
Word
16
8
4
2
1
0
1
1
1
1
10
8
4
2
1
1
1
0
0
1
Ones digits
S
(Lower 16 bits)
Hundreds
Tens
Ones
digits
digits
digits
D
(Lower 4 digits)
BCD/DBCD.
S
D
S
D
Zn
Constant
Others
K, H
6 BASIC INSTRUCTIONS

6.3 Data Conversion Instructions

6
269

Advertisement

Table of Contents
loading

Table of Contents