85
In the above program, the ASCII Unit accepts external input from a keyboard
using the INPUT statement and transfers that data to the PC with the PC
PUT statement.
If the number “1” is input, bit 10308 of the PC is set, directing process (1) to
be executed.
Example 8a
Purpose:
To read and print PC data at specific times using the ASCII Unit
PC READ statement
MOV
#0001
101
10001
MOV
#0000
102
PC Program
ASCII Unit Program
Execution
statement
10300
ASCII busy
WRITE flag
10
OPEN #2,“LPRT:(47)”
20
A$ = “00:00”:B$ = “ “
30
C$ = MID$ (TIME$,4,5)
40
IF C$<>A$ GOTO 30
50
D$ = LEFT$ (TIME$,2)
60
IF D$ = B$ GOTO 30
70
B$ = D$
80
PC READ “I4”;X
90
PRINT #2,“DM = “;X
100
GO TO 30
Remarks:
The printer should be connected to port 2. The baud rate should be set to
4,800 baud.
Example 8b
Purpose:
To read and print PC data at specific times using the ASCII Unit
PC READ(@...) statement
•
This example does not require a PC data transfer routine.
ASCII Unit program:
10
OPEN #2,“LPRT:(47)”
20
A$ = “00:00”:B$ = “ “
30
C$ = MID$ (TIME$,4,5)
40
IF C$<>A$ GOTO 30
50
D$ = LEFT$ (TIME$,2)
60
IF D$ = B$ GOTO 30
70
B$ = D$
80
PC READ “@D,0,1,I4”;X
90
PRINT #2,“DM = “;X
100
GO TO 30
Example 9a
Purpose:
To accept input from the keyboard and write it to the PC using
the PC WRITE statement
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 ...