![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429099.webp)
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.
Example 14
Purpose:
To input data from a bar code reader using the PC WRITE state-
ment
Remarks: Connect the bar code reader to port 2.
STX
Data 1
ETX
Data 2
Data 3
Data 4
Data 5
Data 6
Data 7
Data 8
Data 9
Data 10
The following figure defines the output format of the bar code reader.
PC Program:
DM000
DM001
Data 1
Data 3
DM002
DM003
Data 5
Data 7
DM004
Data 9
Data 2
Data 4
Data 6
Data 8
Data 10
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.
Example 15
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:”
Example Programs
Section 6-1
Содержание SYSMAC C200H-ASC02
Страница 1: ...Cat No W165 E1 04 ASCII Unit SYSMAC C200H ASC02 ...
Страница 2: ...C200H ASC02 ASCII Unit Operation Manual Revised September 2002 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 7: ...TABLE OF CONTENTS viii Glossary 159 Index 163 Revision History 165 ...
Страница 122: ...Appendix B Specifications 115 130 35 100 5 ...
Страница 167: ...Cat No W165 E1 04 Note Specifications subject to change without notice Printed in Japan Authorized Distributor ...
Страница 168: ...Cat No W165 E1 04 C200H ASC02 ASCII Unit OPERATION MANUAL ...