Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L

Скачать
Страница из 1086
6  BASIC INSTRUCTIONS
6.3  Data Conversion Instructions
291
6
Conversion from block BIN 16-bit data to BCD 4-digit data
BKBCD(P)
Processing details
 • Converts BIN data (0 to 9999) n points from device designated by (S) to BCD, and stores result following the device 
designated by (D).
Operation error
 • In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
(S):   Head number of the devices where BIN data is stored (BIN 16 bits)
(D):   Head number of the devices where the converted BCD data will be stored (BCD 4 digits)
n:  
Number of variable data blocks (BIN 16 bits)
Setting 
data
Internal device
R, ZR
J\
U\G
Zn
Constant
K, H
Others
Bit
Word
Bit
Word
(S)
(D)
n
Error 
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH
QnPRH QnU
LCPU
4100
The nth data from the device specified by (S) is outside the 0 to 9999 range.
4101
The points specified in n exceed those of the corresponding device specified 
in (S) or (D).
The same device is specified in (S) and (D).
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
BKBCDP
BKBCD
n
n
S
D
S
D
BKBCDP
BKBCD
BCD conversion
0
BIN 1234
0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
0
BIN 5678
0 0 1 0 1 1 0 0 0 1 0 1 1 1 0
0
BIN 1545
0 0 0 0 1 1 0 0 0 0 0 1 0 0 1
+1
n
Must always be "0".
0
BIN 4321
0 0 1 0 0 0 0 1 1 1 0 0 0 0 1
0
BIN 5555
0 0 1 0 1 0 1 1 0 1 1 0 0 1 1
+(n
1)
+2
+(n
2)
0
BCD 1234
0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
0
BCD 5678
1 0 1 0 1 1 0 0 1 1 1 1 0 0 0
0
BCD 1545
0 0 1 0 1 0 1 0 1 0 0 0 1 0 1
0
BCD 4321
1 0 0 0 0 1 1 0 0 1 0 0 0 0 1
0
BCD 5555
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
S
S
S
S
S
+1
+(n 1)
+2
+(n 2)
D
D
D
D
D
n
8
1
9
2
4
09
6
2
0
4
8
1
0
24
5
12
2
5
6
12
8
64 32 16 8 4 2 1
2
000
1
000
800 4
00
2
00
1
00
80 4
0
2
0
1
0
8 4 2 1
4
000
8000