![background image](http://html1.mh-extra.com/html/omron/c500-asc04/c500-asc04_operation-manual_743033102.webp)
92
7. PC:
Turns ON the Equals Flag when execution of
WRIT(87/191) has been completed and then turns OFF the
self-holding bit (3202).
8. ASCII:
Data is read at line 130 and the results are assigned to the
variables B1 through B4 and then displayed.
Example 18
Purpose:
To initiate data transfer with the START switch using the
WAIT statement
PC Program
ASCII Unit Program
100
PRINT “START”
110
WAIT “10:00.0” , 1000
120
PC READ “I4” ; A, B, C, D, E
130
PRINT A, B, C, D, E
I40
END
1000
PRINT “ERROR READY? Y/N”
1010
F$ = INKEY$
1020
IF F$ = “Y” THEN 100
1030
IF F$ = “N” THEN END
ELSE 1010
Start Input
WRIT(87/191)
#0005
DM100
00
Equals Flag
Next Process
Remarks:
Pressing the PC START switch will cause specified PC data to be transferred to
the ASCII Unit and displayed on the monitor. When the program is executed the
message “Ready” will be displayed on the screen. If the START switch is not
pressed within ten minutes, an error message will be displayed.
Example 19
Purpose:
To direct processing using different interrupts
10 OPEN #1, “TERM:(42)”
20 OPEN #2, “COMU:(42)”
30 ON KEY 1 GOTO 100
40 ON KEY 2 GOTO 200
50 ON PC GOSUB 300
60 ON COM2 GOSUB 400
70 KEY ON: COM2 STOP
80 GOTO 80
100 ’ KEY 1 PROCESSING
110 COM2 ON: PC ON
120 GOTO 120
200 ’ KEY 2 PROCESSING
210 COM2 ON
220 IF A = 1 THEN GOSUB 300
230 GOTO 220
300 ’ PC INTERRUPT PROCESSING
310 PC READ “2I4” ; P, Q
320 LENG = LEN(A$)
330 PCWRITE “I4, 10A3” ; LENG, A$
340 A = 0
350 RETURN
400 ’COM INTERRUPT PROCESSING
410 IF EOF(2) THEN RETURN
420 A$ = INPUT$ (LOC(2), #2)
430 A = 1
440 RETURN
PC Program
ASCII Unit Program
Start Input
WRIT(87/191)
#0002
DM000
00
READ(88/190)
#0011
DM100
01
0102
Programs in Two-word Mode
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...