Omron SYSMAC C200H-ASC02 Operation Manual page 97

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

Example Programs
PC Program
Start 1
Start 2
Start 1
Start 2
Start 1
Start 2
Start 1
Start 2
Start 1
Start 2
Start 1
Start 2
88
Start 3
MOV
#0010
100
Start 3
MOV
#0020
100
Start 3
MOV
#0030
100
Start 3
10001
Start 3
Start 3
Remarks:
Three ON PC GOSUB statements are used to direct program execution to
three different interrupt service routines. After the branch destinations are
defined by the ON PC GOSUB statements, the ON PC statement is executed
enabling the interrupts. The statement "GOTO 60" at line 60 causes the pro-
gram to wait for a PC interrupt to initiate further action.
If PC interrupt 1 interrupts the ASCII Unit, the contents of DM word 0000 will
be printed. If PC interrupt 2 interrupts the ASCII Unit, the contents of DM
words 0010 and 0011 will be printed. If PC interrupt 3 interrupts the ASCII
Unit, the contents of DM words 0100, 0101, and 0102 will be printed.
Connect the printer to port 2 and set the baud rate to 4,800 bps.
The lot sizes are stored in DM words as follows:
ASCII Unit Program
10
OPEN #2,"LPRT:(47)"
20
ON PC 1 GOSUB 100
30
ON PC 2 GOSUB 200
40
ON PC 3 GOSUB 300
50
PC ON
60
GOTO 60
70
PC READ "@D,0,1,I4";X1
80
PRINT #2,"DM0 = ";X1
90
RETURN
200
PC READ "@D,10,2,2I4";X1,X2
210
PRINT #2,"DM10 = ";X1
220
PRINT #2,"DM11 = ";X2
230
RETURN
300
PC READ "@D,100,3,3I4";X1,X2,X3
310
PRINT #2,"DM100 = ";X1
320
PRINT #2,"DM101 = ";X2
330
PRINT #2,"DM102 = ";X3
340
RETURN
WRITE flag
Section 6-1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents