![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h-asc02/sysmac-c200h-asc02_operation-manual_742429051.webp)
41
100
IF LOC (1)=0 THEN 120
110
PRINT INPUT$ (LOC(1),#1)
120
RETURN
Program Remarks:
If an interrupt from port 1 is detected, the buffer contents are displayed.
Note 1. If an interrupt is received on a communications line during processing of
an interrupt routine, a RETURN statement will be returned and a branch
will be made again to the interrupt routine. When this happens, there may
be nothing in the buffer depending on the timing of the interrupt. To handle
this, always place LOC and EOF at the beginning of the interrupt routine
to check if there is data in the buffer, as shown at line 100 in the applica-
tion example given above.
2. When determining the contents of processing for interrupt routines, study
the relationship between the communications speed and processing
speed so that the receive buffers do not overflow while processing the
interrupt routine.
ON ERROR Statement
Purpose:
To enable error processing and to specify the first line number of
the error handling routine
Format:
ON ERROR GOTO <line>
<line> is any valid line number.
Remarks:
When an error occurs, this statement directs execution to the proper error
handling routine. When an error is detected, the error number is assigned to
the variable ERR and the line number where the error occurred is assigned
to ERL.
To disable error processing, execute ON ERROR GOTO 0. Subsequent er-
rors will cause an error message to be printed and execution to be halted.
If an error occurs during execution of an error handling subroutine, a BASIC
error message will be printed and execution terminated.
Refer to the discussion of the RESUME Command, and the ERR and ERL
functions.
ON GOSUB and ON GOTO Statements
Purpose:
To branch to one of several specified line numbers, depending
on the resultant evaluation of a numeric or logical expression
Format:
ON <expression> GOTO <list>
ON <expression> GOSUB <list>
<expression> is any valid expression.
<list> is a list of valid line numbers separated by comas.
Example:
ON X-2 GOSUB 50,100,150
Remarks:
The value of <expression> determines which line number in the list will be
used for branching. For example, if the result is 2, then the second line num-
ber in the list will be chosen for branching. If the resultant value is not an inte-
ger, the fractional part is rounded off.
In the ON...GOSUB statement, each line number in the list must be the first
line number of a subroutine.
BASIC Language
Section 4-2
Содержание 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 ...