572
7 APPLICATION INSTRUCTIONS
7.11 Character String Processing Instructions
Conversion from hexadecimal BIN to ASCII
ASC(P)
• Converts the BIN 16-bit data stored in the area starting from the device designated by (S) to ASCII by treating the BIN data
in hexadecimal representation. Then, stores the converted data into the area starting from the device designated by (D), for
the number of characters specified by n.
• The use of n to set the number of characters causes the BIN data range designated by (S) and the character string storage
device range designated by (D) to be set automatically.
• Processing will be performed accurately even if the device range where BIN data to be converted is being stored overlaps
with the device range where the converted ASCII data will be stored.
(S): Head number of the devices where BIN data to be converted to a character string is stored (BIN 16 bits)
(D): Head number of the devices where the converted character string will be stored (character string)
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
ASC
ASCP
n
n
ASC
ASCP
S D
S D
+1
+2
+3
+6
When "15" is
set for n
1
H 2H 3H 4H
+1
+4
+5
+7
5H 6H 7H 8H
FH
EH DH
CH
AH 9H
BH
6H
BIN data
+1
+2
+3
+1
+2
+3
ASCII code for the 1st digitASCII code for the 2nd digit
ASCII code for the 3rd digitASCII code for the 4th digit
b15 b8b7 b0
ASCII code for the 1st digitASCII code for the 2nd digit
ASCII code for the 3rd digitASCII code for the 4th digit
ASCII code for the 1st digitASCII code for the 2nd digit
34H (4)33H (3)
32
H (2)31H (1)
38H (8)37H (7)
36
H (6)35H (5)
44H (D)
46
H (F)
42
H (B)
00
H
43H (C)
45
H (E)
36
H (6)
39
H (9)
4th digit 3rd digit 2nd digit 1st digit
4th digit 3rd digit 2nd digit 1st digit
4th digit 3rd digit 2nd digit 1st digit
b15 b12 b8b11 b7 b4 b0b3
S
D
S
D
D
D
b15 b12 b8b11 b7 b4 b0b3
b15 b8b7 b0
D
D
D
D
D
D
D
D
S
S
S
S
Number of
characters
designated by n
D12
D13
D11
D12
D13
D14
D11
D10
b15 b8 b7 b0
b15 b12 b8b11 b7 b4 b0b3
32H (2) 31H (1)
34H (4)
36H (6)
38H (8)
41H (A)
33H (3)
35H (5)
37H (7)
39H (9)
4H
8H
3H
7H
2H
6H
AH
1H
5H
9H