Omron SYSMAC C200H-ASC02 Operation Manual page 48

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

Advertisement

BASIC Language
KEY(n) Statement
38
A comma may be used instead of a semicolon after the prompt string to sup-
press the question mark.
Data is not accepted by the INPUT statement until a carriage return is en-
tered. Therefore input can be edited with the backspace and delete keys.
When more than two variables are input, they must be delimited by commas
or colons.
The data entered is assigned to the variables specified by the INPUT state-
ment. The number of values entered must be the same as the number of
variables in the INPUT statement.
The variable names in the list may be numeric or string variable types as well
as subscripted variables (array variable). The type of each entered data item
must agree with the type specified by the variable name.
Strings input to an INPUT statement need not be surrounded by quotation
marks.
Responding to INPUT with too many or too few items will cause an error
message to be displayed prompting the user to re-enter the data.
If a peripheral device other than TERM or COMU is selected by the OPEN
statement, neither the prompt statement nor "?" is displayed.
To eliminate "?" when COMU, etc., is selected by the OPEN statement, use
the LINE INPUT command.
The INPUT statement cannot be executed in direct mode. If the port number
is omitted, port 1 is assumed as the default port.
Purpose:
To enable, disable, or stop an interrupt invoked by key input and
defined by the ON KEY GOTO or ON KEY GOSUB statements
Format:
KEY(<n>) ON/OFF/STOP
<n> is the key number (1-8).
Example:
KEY(4) ON
Remarks:
The KEY ON statement enables an interrupt invoked by keyboard input. After
this statement has been executed, an interrupt will be triggered each time the
specified key is input. Program execution then branches to an interrupt ser-
vice routine defined with the ON KEY GOTO or ON KEY GOSUB statements.
The KEY OFF statement disables the interrupt; key input will no longer trig-
ger an interrupt.
The KEY STOP statement also disables the interrupt. However, if the inter-
rupt is subsequently enabled with the KEY ON statement, execution will then
branch to the interrupt service routine defined by the ON KEY GOTO or ON
KEY GOSUB statements.
Execute the KEY OFF statement at the end of the program.
Program Example:
10
OPEN #1, "TERM:(42)"
20
ON KEY 1 GOSUB 100
30
On KEY 2 GOSUB 200
40
A=0
50
KEY ON
60
GOTO 60
Section 4-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents