80
6-1
Example Programs
This section presents examples of data transfer routines written for both the
PC and the ASCII Unit. The examples illustrate how the two programs work
together to transfer data. Some of the examples have two ASCII Unit rou-
tines; the first one runs in conjunction with a PC routine and the second one
runs independently of the PC and does not require a PC program.
Throughout this section, the following is assumed:
Unit no. : 0
Data area of PC: DM
Example 1a
Purpose:
To transfer data from the PC to the ASCII Unit using the PC
READ statement
MOV(21)
#0005
101
Transfer base word (DM 0000)
10001
MOV(21)
#0000
102
PC Program
ASCII Unit Program
Execution
statement
10300
ASCII busy
specifies the number of
words to be transferred
specifies the base word
for data transfer
WRITE flag
PC READ “5I4”; A,B,C,D,E
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, when the execution statement flag is set, the data stored in
words 0000 to 0004 is written to the ASCII Unit after the WRITE flag (word n
bit 01) has been set.
When the ASCII Unit executes the PC READ statement, five specified words
are read by the BASIC program, converted into BCD and assigned to the
variables A through E. During execution of the PC READ statement, the
ASCII Unit busy flag (word n+3 bit 00) is set. When execution is complete,
the busy flag is cleared.
Example 1b
Purpose:
To use the ASCII Unit PC READ statement to specify and read
data from the PC independently of the PC program
•
This example does not require a PC data transfer routine.
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 ...