IAI America SSEL User Manual
Page 235
213
Part 2 Programs
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.
A return code will be stored in a local variable (variable 99 under the factory setting)
immediately after this command is executed.
Whether or not the command has been executed successfully can be checked based on this
return code. Define appropriate processing to handle situations where the command
execution failed due to an error.
Setting “0” in operand 2 will specify a dummy read (receive buffer cleared and receive
disabled) (the return code will indicate that the command was successfully executed).
[Example]
SCHA
10
Set LF (= 10) as the end character.
OPEN
0
Open
channel
0.
READ
0
2
Read a character string from channel 0 to column
2 until LF is received.
TRAN
1
99
Assign the return code (variable 99) to variable 1.
CLOS
0
Close the channel.
SLCT
The processing flow branches out in accordance
with each return code.
(Note) Using a GOTO command to branch out of
an SLCT-EDSL syntax or to other branch
processing within the syntax is prohibited.
WHEQ
1
0
:
(1)
:
If the content of variable 1 is “0” (Completed
successfully), (1) will be executed. In (1), define
the processing that should take place upon
successful command execution.
WHEQ
1
1
:
(2)
:
If the content of variable 1 is “1” (Timeout), (2) will
be executed. In (2), define appropriate processing
to handle this situation, if necessary.
WHEQ
1
2
:
(3)
:
If the content of variable 1 is “2” (Timer cancelled),
(3) will be executed. In (3), define appropriate
processing to handle this situation, if necessary.
OTHE
:
(4)
:
If the content of variable 1 is not “0,” “1” or “2,” (4)
will be executed. In (4), define appropriate error
handling, if necessary.
EDSL
Once one of the specified conditions was met and
the corresponding command has been executed,
the processing will move here.