![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429091.webp)
82
Remarks:
When the ASCII Unit executes the PC WRITE “@...” statement, the variables
P, Q, and R are converted into BCD and stored in DM words 0010, 0011, and
0012. During PC WRITE execution, the busy flag (word n+3 bit 00) is set.
Example 3
Purpose:
To print data at fixed time intervals using the LPRINT statement
•
This example does not require a PC data transfer routine.
ASCII Unit Program:
100
TH$ = MID$(TIME$,1,2)
110
IF TH$ = TH0$ GOTO 200
120
TH0$ = TH$
130 LPRINT
TIME$,A
Remarks:
This program example prints a value (A) and the present time (TIME$) on a
printer every hour on the hour. The PRINT statement is executed when the
“hours” change on the internal clock (for example, when the time changes
from 9:59 to 10:00). The clock (24-hour) must be set prior to program execu-
tion.
Example 4a
Purpose:
To transfer data from the keyboard to the PC using the BASIC
“INPUT” statement
10
OPEN #2, “KYBD:”
20
INPUT #2,A$
30
PC WRITE “2A3”;A$
MOV
#0002
101
10002
MOV
#0020
102
PC Program
ASCII Unit Program
Execution
statement
10300
ASCII busy
READ flag
specifies the number of
words to be transferred
specifies the number of
words to be transferred
specifies the transfer
base word
Transfer base word (DM 0020)
Number of words to be transferred
Word n+1
Word n+2 (where n = 100 +10 x unit no.)
A
B
C
D
A
B
C
D
Remarks:
In this example, “2A3” means that the low order byte of the first word and the
high order byte of the second word are written.
In this example, data is entered from a keyboard connected to port 2 of the
ASCII Unit and then written to the PC using the PC WRITE statement. Two
Example Programs
Section 6-1
Summary of Contents for SYSMAC C200H-ASC02
Page 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Page 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Page 122: ...Appendix B Specifications 115 130 35 100 5 ...
Page 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...