![Mitsubishi Electric FX5U Series Скачать руководство пользователя страница 67](http://html.mh-extra.com/html/mitsubishi-electric/fx5u-series/fx5u-series_training-manual_1811871067.webp)
Data Conversion Instructions
Converting binary data to BCD 4-digit data
BCD(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.
Processing details
These instructions convert the 16-bit binary data (0 to 9999) in the device specified by (s) to BCD 4-digit data, and store the
converted data in the device specified by (d).
Ladder diagram
Operand
Description
Range
Data type
(s)
Binary data or the head device where the binary data is stored
0 to 9999
16-bit signed binary
(d)
Head device for storing the BCD data
BCD 4-digit
(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)
BCD
(1): Set 0s.
Data specified by (s) can be converted if it is within the range from K0 to K9999 BCD (decimal).
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
K1Y0
1-digit
0 to 9
K2Y0
2-digit
00 to 99
K3Y0
3-digit
000 to 999
K4Y0
4-digit
0000 to 9999
Error code
(SD0/SD8067)
Description
3401H
Data in the device specified by (s) is out of the valid range (0 to 9999).
BCD
(s)
(d)
X0
BIN
BCD
When "K4Y000" is specified
CPU module BCD
Y14 to
Y17
Y10 to
Y13
Y4 to
Y7
Y0 to
Y3
67
Содержание FX5U Series
Страница 1: ...FX5U Training Manual ...