IAI America XSEL-QX User Manual

Page 303

Advertising
background image

279

Part 4 Commands

z READ (Read)

Command, declaration

Extension condition

(LD, A, O, AB, OB)

Input condition

(I/O, flag)

Command,
declaration

Operand 1

Operand 2

Output

(Output, flag)

Optional Optional

READ

Channel

number

Column

number

CC

[Function]

Read a character string from the channel specified in operand 1 to the column specified in
operand 2.
Read will end when the character specified by a SCHA command is received.
Either a local or global column may be specified.
Immediately after this command is executed, a return code will be stored in a local variable
(variable 99 based on the factory setting). You can check the return code to see if the
command has been executed successfully. If necessary, define a process to be performed
in the event that the command was aborted due to an error.
With the main application of version 0.41 or later, a dummy read (clearing the receive buffer
and disabling reception) can be implemented by specifying “0” in operand 2 (the return
code will indicate successful completion). The versions of tools that permit entry of “0” in
operand 2 are shown below. If “0” cannot be entered from your tool, you can still specify a
dummy read indirectly:
x PC software: Version 1.1.1.0 or later
x Teaching pendant application: Version 1.06 or later

[Example]

SCHA 10

Set LF (= 10) as the end character.

OPEN

1

Open

channel

1.

READ 1

2

Read a character string from channel 1 to column 2 until
LF is received.

TRAN 1

99

Assign the return code (content of variable 99) to
variable 1.

CLOS 1

Close the channel.

SLCT

WHEQ

:

[1]

:

1 0

The program branches to the process corresponding to
each return code.
(Note) Using a GOTO command to branch out of or into
a SLCT-EDSL syntax is prohibited.
If the content of variable 1 is “0” (completed
successfully), [1] is executed. Define the process to be
performed upon successful completion of the command,
in [1].

WHEQ

:

[2]

:

1

1

If the content of variable 1 is “1” (timeout occurred), [2]
is executed. If necessary, define an appropriate process
to be performed upon timeout, in [2].

WHEQ

:

[3]

:

1

2

If the content of variable 1 is “2” (timer cancelled), [3] is
executed. If necessary, define an appropriate process to
be performed upon timer cancellation, in [3].

OTHE

:

[4]

:

If the content of variable 1 is not “0,” “1” or ‘2,” [4] is
executed. If necessary, define an appropriate process to
be performed in this condition, in [4].

EDSL

If any of the above conditions was satisfied and the
corresponding part of the command has been executed,
the program jumps to this step.

Advertising
This manual is related to the following products: