322
4
4 Instructions4.12.4 Other Peripheral Instructions
4.12.4 Other Peripheral Instructions
Other peripheral
instructions
ASC ASCII code conversion
PR ASCII code printing
MTR Input matrix
PRUN Octal bit transfer
ARWS Arrow switch
ABSD Absolute cam control mode
INCD Incremental cam control mode
ROTC Rotary table control
GRY Gray code conversion
GBIN Gray code inverse conversion
ASC: ASCII code conversion
◆
Overview
When driving conditions are met, the ASC instruction converts the string S1 input by a PC to ASCII codes.
The result is stored in registers from head address D1.
ASCII S D
ASCII code
conversion
Applicable model:
H3U
S Data source
Alphanumeric string (which consists of up to eight
characters) to be converted to ASCII codes
16-bit instruction
(11 steps)
ASCII: Continuous
execution
D
Conversion
result
Start number of four (M8161 = 0) or eight (M8161 = 1)
consecutive variable units that store the ASCII codes after
conversion
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S Alphanumeric string that is input manually
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
Example:
X20
ǒ
ASC Stopped D200
Ǔ
S
D
54˄t˅ 53˄S˅
50˄p˅ 4F˄o˅
45˄e˅ 50˄p˅
20
44˄d˅
D200
D201
D202
D203
Higher bytesLower bytes
The figure on the right shows the
values assigned to D200 to
D203 when X20 = ON.
If the special register M8161 is set to ON, each ASCII character after conversion occupies a 16-bit variable,
as shown in the following gure. The higher byte of each variable is set to 0.