DVP-ES2/EX2/EC5/SS2/SA2/SX2/SE&TP Operation Manual - Programming
API
Mnemonic Operands Function
76 ASC
ASCII code conversion
Type
OP
Bit Devices Word devices Program Steps
X Y M S K H KnX
KnY
KnM
KnS
T C D E F
ASC: 11 steps
SS2
SX2
SS2
SX2
SS2
SX2
Operands:
S: English letters to be converted into ASCII code (A~Z or a~z only) D: Device for storing ASCII
code
Explanation:
1. The ASC instruction converts 8 English letters stored in S and save the converted ASCII code
in D. The value in S can be input by WPLSoft or ISPSoft.
2. If PLC is connected to a 7-segment display while executing ASC instruction, the error message
can be displayed by English letters
3. Flag: M1161 (8/16 bit mode switch)
Program Example:
When X0 = ON, A~H is converted to ASCII code and stored in D0~D3.
D0
D1
D2
b15 b0
42H (B) 41H (A)
44H (D) 43H (C)
46H (F) 45H (E)
D3
48H (H) 47H (G)
Low byteHigh byte
When M1161 = ON, every ASCII code convert
the letters will occupy the lower 8 bits (b7 ~ b0) of a
register and the upper 8 bits are invalid (filled by 0),
i.e. one register stores a letter
b15 b0
D0
D2
D4
D6
D1
D3
D5
D7
00 H
0
0 H
00 H
00 H
00 H
00 H
00 H
00 H
41H (A)
42H (B)
43H (C)
44H (D)
45H (E)
46H (F)
47H (G)
48H (H)
Low byte
High byte