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

Скачать
Страница из 1086
7  APPLICATION INSTRUCTIONS
7.11  Character String Processing Instructions
575
7
Conversion from ASCII to hexadecimal BIN
HEX(P)
Processing details
 • Converts the number of characters of hexadecimal ASCII data designated by n stored in the area starting from the device 
number designated by (S) into BIN values and stores them in the area starting from the device number designated by (D).
For example, if the number 9 has been designated by n, the operation would be as follows:
(S):   Head number of the devices where a character string to be converted to BIN data is stored (character string)
(D):   Head number of the devices where the converted BIN data will be stored (BIN 16 bits)
n:  
Number of characters to be stored (BIN 16 bits)
Setting 
data
Internal device
R, ZR
J\
U\G
Zn
Constant
K, H
Others
Bit
Word
Bit
Word
(S)
(D)
n
Process
High
performance
Redundant Universal
LCPU
Basic
Command
Command
HEX
HEXP
n
n
S
D
S
D
HEX
HEXP
b15
b8 b7
b0
b15
b12
b8
b11
b7
b4
b0
b3
(S)
(S)+1
(S)+2
(S)+3
(D)
(D)+1
·
BIN data
ASCII code for the 1st digit
ASCII code for the 2nd digit
ASCII code for the 3rd digit
ASCII code for the 4th digit
ASCII code for the 1st digit
ASCII code for the 2nd digit
ASCII code for the 3rd digit
ASCII code for the 4th digit
4th digit
3rd digit
2nd digit
1st digit
4th digit
3rd digit
2nd digit
1st digit
Number of 
characters 
designated 
by n
34H (4)
33H (3)
32H (2)
31H (1)
36H (6)
42H (B)
39H (9)
41H (A)
38H (8)
45H (E)
0H
0H
EH
AH
9H
BH
6H
1H
2H
3H
4H
0H
(S)
(S)+1
(S)+2
(S)+3
(S)+4
(D)
(D)+1
(D)+2
b15
b12
b8
b11
b7
b4
b0
b3
b15
b8 b7
b0
When "9"
is set 
for n
Code "38H" remains unchanged since the designated number of characters is "9".