Omron SYSMAC C200H-ASC02 Operation Manual page 99

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

Advertisement

Example Programs
Example 14
Example 15
90
ASCII Unit Program:
10
OPEN #2,"SCRN:(40)"
20
PC READ "@R,10,1,B0";R
30
IF R = 0 THEN RS$ = "OFF"
ELSE RS$ = "ON"
40
PRINT #2,"RELAY = ";RS$
Remarks:
The PC READ "@..." statement is used with "@R" as the first argument di-
recting the read statement to obtain the data from the PC Relay memory
area.
Purpose:
To input data from a bar code reader using the PC WRITE state-
ment
Remarks:
Connect the bar code reader to port 2.
The following figure defines the output format of the bar code reader.
STX
Data 1
Data 2
PC Program:
DM000
Data 1
DM001
Data 3
DM002
Data 5
DM003
Data 7
DM004
Data 9
ASCII Unit Program :
10
OPEN #2,"COMU:(22)"
20
A$ = INPUT$ (1,#2)
30
IF A$ = CHR$(2) GOTO 50
40
GOTO 20
50
B$ = INPUT$(11,#2)
60
IF CHR$(3) = RIGHT$ (B$,1)
THEN B$ = MID$(B$,1,10)
ELSE GOTO 20
70
PC WRITE "@D,0,5,5A3";B$
80
GOTO 20
Note For details on the COMU statement, refer to the description of the OPEN
statement in Section 4-2-4 Device Control Statements.
Purpose:
To read data from an input file through a com port
• This example does not require a PC data transfer routine.
ASCII Unit Program
10
CLEAR 1000
100
OPEN #1,"COMU:"
Data 3
Data 4
Data 5
Data 6
Data 2
Data 4
Data 6
Data 8
Data 10
Section 6-1
Data 7
Data 8
Data 9
Data 10
ETX

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents