Omron SYSMAC C200H-ASC02 Operation Manual page 94

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

Advertisement

Example Programs
Example 8a
PC Program
Execution
statement
Example 8b
Example 9a
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.
Purpose:
To read and print PC data at specific times using the ASCII Unit
PC READ statement
10300
ASCII busy
Remarks:
The printer should be connected to port 2. The baud rate should be set to
4,800 baud.
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
Purpose:
To accept input from the keyboard and write it to the PC using
the PC WRITE statement
ASCII Unit Program
10
OPEN #2,"LPRT:(47)"
20
A$ = "00:00":B$ = " "
MOV
30
C$ = MID$ (TIME$,4,5)
#0001
40
IF C$<>A$ GOTO 30
101
50
D$ = LEFT$ (TIME$,2)
60
IF D$ = B$ GOTO 30
70
B$ = D$
80
PC READ "I4";X
MOV
90
PRINT #2,"DM = ";X
#0000
100
GO TO 30
102
10001
WRITE flag
Section 6-1
85

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents