Mitsubishi Electronics QCPU Welding System User Manual


  Open as PDF
of 1204
 
7-229
ASC(P)
1
2
3
4
6
6
7
8
7.11 Character string processing instructions
7.11.13 Conversion from hexadecimal BIN to ASCII (ASC(P))
(2) The use of n to set the number of characters causes the BIN data range designated by
and the character string storage device range designated by to be set automatically.
(3) 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.
(4) If an odd number of characters has been designated by n, the ASCII code "00
H" will be
automatically stored in the upper 8 bits of the final device in the range where the character
string is to be stored.
When 5 characters have been designated by n.
(5) If the number of characters designated by n is "0", conversion processing will not be
conducted.
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and
an error code is stored into SD0.
The range for the number of characters designated by n following the device number
designated by exceeds the relevant device range. (Error code: 4101)
The range for the number of characters designated by n following the device number
designated by exceeds the relevant device range. (Error code: 4101)
Program Example
(1) The following program reads the BIN data being stored at D0 as hexadecimal values,
converts them to a character string, and stores the result from D10 to D14 when X0 is turned
ON.
[Ladder Mode] [List Mode]
[Operation]
S
D
D12
D13
D11
D12
D13
D14
D11
31
H
32
H
33
H
34
H
35
H
36
H
37
H
38
H
41
H
39
H
D10
A
H
9
H
8
H
7
H
6
H
5
H
4
H
3
H
2
H
1
H
b15 b8b7 b0
b15 b12 b8b11 b7 b4 b0b3
42
H
(B)32
H
(2)
41
H
(A)31
H
(1)
42
H
(B)00
H
B
1A2
B
+1
Stored automatically
+1
+2
b15 b8b7
b0
b15 b12 b8b11 b7 b4 b0b3
S
S
S D
D
D
S
S
S
D
Instruction
Device
Step
39
H
(9)
32
H
(2)
37
H
(7)
43
H
(C)
46
H
(F)
41
H
(A)
35
H
(5)30
H
(0)
32
H
(2)32
H
(2)
D1
D2
D11
D12
D13
D14
D0
D10
2
H
2
H
0
H
5
H
A
H
F
H
C
H
7
H
2
H
9
H
0
H
0
H
b15 b8
b7
b0b15 b12 b8b11
b7
b4 b0b3