![background image](http://html1.mh-extra.com/html/omron/c500-asc04/c500-asc04_operation-manual_743033105.webp)
95
Example 4
Purpose:
To print out production data every hour from DM000.
10
’ DM PRINTING PROGRAM
20
OPEN #2, “LPRT: (47)”
30
A$ = 00 : 00”
40
B$ = MID$(TIME$, 4, 5)
50
IF B$ <> A$ GOTO 40
60
PC PUT 1
70
PC READ “I4” ; X
80
PRINT #2, “DM = ” ; X
190
PC PUT 0
100
GOTO 40
PC Program
ASCII Unit Program
0308
MOV(21/030)
DM000
00
0101
3200
3201
DIFU 3200
DIFD 3201
Example 5
Purpose: To accept input from the keyboard and write it to the PC us-
ing the PC WRITE statement
MOV(21/030)
PC Program
ASCII Unit Program
0302
10
INPUT I
20
PC WRITE “I4” ; I
30
GOTO 10
0102
02
DM000
0102
Remarks:
Product codes stored in DM memory are replaced by data input through a key-
board. The data is represented as 4-digit hexadecimal numbers.
Example 6
Purpose:
To read data from an input file through a communications
port
ASCII Unit Program
10
CLEAR 1000
100
OPEN #1,“COMU:”
110
OPEN #2,“COMU:”
120
ON COM1 GOSUB 1000
130
ON COM2 GOSUB 2000
140
COM1 ON:COM2 ON
150
GOTO 150
1000
A = LOC(1)
1010
IF A<>0 THEN
A$ = A$+INPUT$(A,#1)
1020 RETURN
Programs in Four-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 ...