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

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

Advertisement

Converting BCD 8-digit data to binary data

DBIN(P)
These instructions convert the binary-coded decimal data in the device specified by (s) to binary data, and store the converted
data in the device specified by (d).
Use this instruction to convert a binary-coded decimal (BCD) value such as a value set by a digital switch into binary (BIN)
data and to receive the converted binary data so that the data can be handled in operations in CPU module.
Ladder diagram
(s)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Binary-coded decimal data or the head device where the
binary-coded decimal data is stored
(d)
Head device for storing the binary data
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB
(s)
(d)
Processing details
• These instructions convert the BCD 8-digit data (0 to 99999999) in the device specified by (s) to 32-bit binary data, and
store the converted data in the device specified by (d).
10
8
4
(s)
BCD 99999999 1
0
Ten-millions
place
31
30
2
2
2
(d)
0
0
BIN 99999999
Always becomes "0".
• The data in the device specified by (s) can be converted if it is in the range from 0 to 99999999 (BCD).
• The table below shows nibble specification for the data in the device specified by (s) and (d).
Command
input
DBIN
(s)
6 BASIC INSTRUCTIONS
248
6.5 Data Conversion Instructions
(d)
Word
U\G T, ST,
T, ST, C, D,
C, LC
W, SD, SW, R
(s)+1
10
10
10
7
6
5
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
millions
Hundred-
Ten-
place
thousands
thousands
place
place
(d)+1
29
28
27
26
25
24
23
22
21
20
19
18
17
2
2
2
2
2
2
2
2
2
2
2
2
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
(d)
2
3
In case of K8X0
X34 to
X30 to
X37
X33
Structured text
ENO:=DBIN(EN,s,d);
ENO:=DBINP(EN,s,d);
Range
0 to 99999999
Double word Indirect
U\G
Z
LC
(s)
10
10
10
4
3
2
1
Thousands
Hundreds
Tens
place
place
place
Binary conversion
(d)
16
15
14
13
12
11
10
9
8
7
6
5
2
2
2
2
2
2
2
2
2
2
2
2
4
5
6
7
8
X24 to
X20 to
X14 to
X10 to
X27
X23
X17
X13
DBIN
CPU module
Data type
BCD 8-digit
32-bit signed binary
specification
LZ
10
0
Ones
place
4
3
2
1
0
2
2
2
2
2
BCD
9
X4 to
X0 to
X7
X3
BIN
Data type (label)
ANY32
ANY32
Constant
Others
K, H
E
$

Advertisement

Table of Contents
loading

Table of Contents