![Mitsubishi Electric FX5U Series Скачать руководство пользователя страница 68](http://html.mh-extra.com/html/mitsubishi-electric/fx5u-series/fx5u-series_training-manual_1811871068.webp)
Converting BCD 4-digit data to binary data
BIN(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.
Processing details
These instructions convert the BCD 4-digit data (0 to 9999) in the device specified by (s) to 16-bit binary data, and store the
converted data in the device specified by (d).
Ladder diagram
Operand
Description
Range
Data type
(s)
Binary-coded decimal data or the head device where the
binary-coded decimal data is stored
0 to 9999
BCD 4-digit
(d)
Head device for storing the binary data
16-bit signed binary
(1): Filled with 0s.
(s)
(d)
BIN 9999
BCD 9999
32768 16384 8192 4096 2048 1024
512
256
128
64
32
16
8
4
2
1
8000 4000 2000 1000
800
400
200
100
80
40
20
10
8
4
2
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
(s)
(d)
×10
3
×10
2
×10
1
×10
0
(1)
BIN
The data in the device specified by (s) can be converted if it is in the range from 0 to 9999 (BCD).
The table below shows nibble specification for the data in the device specified by (s) and (d).
Precautions
Binary data is used in all operations in CPU module including arithmetic operations (+-
), increment and decrement
instructions. When receiving digital switch information in binary-coded decimal (BCD) format into a CPU module, use
the BIN(P) instructions (for converting BCD data into binary data). Furthermore, to output data to seven-segment display
unit handling binary-coded decimal (BCD) data, use the BCD(P) instructions (for converting binary data into BCD data).
Operation error
(d)
Number of digits
Data range
K1X0
1-digit
0 to 9
K2X0
2-digit
00 to 99
K3X0
3-digit
000 to 999
K4X0
4-digit
0000 to 9999
Error code
(SD0/SD8067)
Description
3401H
The value of each digit of the device specified by (s) is other than 0 to 9. (The data is not binary-coded decimal data.)
BIN
(s)
(d)
X0
BCD
BIN
9
7
8
6
BIN CPU module
In case of K4X0
X14 to
X17
X10 to
X13
X4 to
X7
X0 to
X3
68
Содержание FX5U Series
Страница 1: ...FX5U Training Manual ...