![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429092.webp)
83
PC words are used to store the data, which consists of four characters (two
characters per word).
When the execution statement flag is set, the data is stored in DM words
0020 and 0021.
The ASCII Unit OPENs port 2 as the keyboard, and stores the entered char-
acters as a character string, A$. The character string is terminated with a car-
riage return.
Example 4b
Purpose:
To use the PC WRITE statement to specify and write data to the
PC DM area
•
This example does not require a PC data transfer routine.
ASCII Unit Program:
10
OPEN #2,“KYBD:”
20
INPUT #2,A$
30
PC WRITE “@D,20,2,2A3”;A$
Remarks:
When the PC WRITE “@...” statement is executed, the first four characters of
character string A$ are converted into ASCII code and stored in DM words
0020 and 0021.
During PC WRITE “@...” execution, the busy flag (word n+3 bit 00) is set.
Example 5
Purpose:
To control the ASCII Unit from the PC using the ON PC state-
ment
50
ON PC 3 GOSUB 200
60
ON PC 4 GOSUB 300
70
PC ON
200
A = 1234:RETURN
300
A = 2345:RETURN
10001
PC Program
ASCII Unit Program
Execution
statement
WRITE flag
MOV
#0030
100
Remarks:
In this example, the PC controls execution of the ASCII Unit by means of an
interrupt.
When the ASCII Unit ON PC GOSUB statement is executed (the PC ON
statement must be executed to enable the interrupts ) the PC can then inter-
rupt the ASCII Unit. Each interrupt generated by the PC has a unique inter-
rupt number associated with it. This number is written to the ASCII Unit Pro-
gram and causes branching to a corresponding interrupt service routine. In
the above example, the unique interrupt number is 3, causing a branch to
line 200 of the BASIC program.
Example Programs
Section 6-1
Содержание SYSMAC C200H-ASC02
Страница 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Страница 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Страница 122: ...Appendix B Specifications 115 130 35 100 5 ...
Страница 167: ...Cat No W165 E1 04 Note Specifications subject to change without notice Printed in Japan Authorized Distributor ...
Страница 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...