IAI America SSEL User Manual
Page 237
215
Part 2 Programs
z TMRW (Set READ/WRIT timeout value)
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
TMRW
Read timer
setting
(Write timer
setting)
CP
[Function] Set the timeout to be applied to a READ/WRIT command.
With the SSEL controller, a write timer setting cannot be specified.
The timer setting specified in operand 1 will set the maximum time the program will wait for
the character string read to end when a READ command is executed.
If the end character could not be read before the timer is up during the execution of the
READ command, a timeout will occur and the program will move to the next step.
(Whether or not a timeout has occurred can be checked from the return code that will be
stored in variable 99 (factory setting) immediately after the READ command is executed. If
necessary, define appropriate processing to handle a timeout.)
Setting the timer to “0” will allow the READ command to wait infinitely, without timeout, until
the end character is read.
The timer setting is input in seconds (setting range: 0 to 99.00 seconds) including up to two
decimal places.
A variable can be specified indirectly in operand 1.
(Note)
TMRW is set to “0” in the default condition before TMRW setting is performed.
[Example]
SCHA
10
Set LF (=10) as the end character.
TMRW
30
Set the READ timeout value to 30 seconds.
OPEN
0
Open
channel
0.
READ
0
2
Read the character string from channel 0 to
column 2 until LF is read.
TRAN
1
99
Assign the return code 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.