Download Print this page

Converting Binary Data To Bcd 8-Digit Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Converting binary data to BCD 8-digit data

DBCD(P)
These instructions convert the binary data in the device specified by (s) to BCD data, and store the converted data in the
device specified by (d).
Binary data is used in operations in CPU module. Use this instruction to display numeric values on seven-segment display
unit equipped with BCD decoder.
Ladder diagram
(s)
FBD/LD
EN
ENO
s
d
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Binary data or the head device where the binary data is
stored
(d)
Head device for storing the BCD data
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
Processing details
• These instructions convert 32-bit binary data (0 to 99999999) in device specified by (s) to BCD 8-digit data, and store the
converted data in the device specified by (d).
2
31
2
30
2
(s)
BIN 99999999
0
0
(1)
×10
8
4
(d)
BCD 99999999 1
0
(1): Set 0s to the upper 5 bits.
7 BASIC INSTRUCTIONS
284
7.5 Data Conversion Instructions
(d)
Word
T, ST, C, D, W,
SD, SW, R
(s)+1 (Upper 16 bits)
29
2
28
2
27
2
26
2
25
2
24
2
23
2
22
2
21
2
20
2
19
2
18
2
17
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
7
×10
6
×10
5
×10
2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 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)+1 (Upper 4 digits)
Structured text
ENO:=DBCD(EN,s,d);
ENO:=DBCDP(EN,s,d);
Range
0 to 99999999
Double word Indirect
U\G
Z
LC
(s) (Lower 16 bits)
2
16
2
15
2
14
2
13
2
12
2
11
2
10
2
9
2
8
2
7
2
6
2
5
BCD
4
×10
3
×10
2
×10
1
(d) (Lower 4 digits)
Data type
32-bit signed binary
BCD 8-digit
Bit
Bit
Constant
specification
LZ
K, H
2
4
2
3
2
2
2
1
2
0
×10
0
Data type (label)
ANY32
ANY32
BOOL
BOOL
Others
E
$

Hide quick links:

Advertisement

loading