3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-213
API Mnemonic
Operands
Function
76
ASC
S, D
ASCII Code Conversion
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
D
*
*
*
ASC: 11 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: The alphanumeric character to be converted to ASCII code
D
: The destination address for
storing the ASCII code
Explanation:
1.
The ASC instruction converts 8 characters stored in
S
to ASCII code and stores the result in
D
.
The values in
S
can be entered with ELCSoft programming software.
2.
The alphanumeric characters can be used to display error messages.
3.
Flag: M1161 selects 8 or 16 bit mode.
Program Example:
When X0=ON, A~H is converted to ASCII code and stored in D0~D3.
X0
ASC
A B C D E F G H
D0
D0
D1
D2
b15
b0
42H (B)
41H (A)
44H (D)
43H (C)
46H (F)
45H (E)
D3
48H (H)
47H (G)
Low byte
High byte
When M1161=ON, the ASCII code converted from
each character will be placed in the lower 8-bits
(b7~b0) of one register. The high byte will be invalid
and its contents filled with 0. This also means that one
register is used to store one character.
b15
b0
D0
D2
D4
D6
D1
D3
D5
D7
00 H
00 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
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...