beautypg.com

Optional, Optional tmrd timer setting prohibited cp – IAI America XSEL-KX User Manual

Page 214

background image




198

Part 4 Commands


 TMRD (Set READ timeout value)

Extension condition

(LD, A, O, AB, OB)

Input condition

(I/O, flag)

Command, declaration

Output

(Output, flag)

Command,
declaration

Operand 1

Operand 2

Optional

Optional

TMRD

Timer

setting

Prohibited

CP

[Function]

Set the timeout to be applied to a READ command.
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 to be stored in
a local variable (factory setting: variable 99) immediately after the READ command has been
executed. Specify an appropriate processing to be performed upon timeout, if necessary.)
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.

(Note)

TMRD is set to “0” in the default condition before TMRD setting is performed.

[Example]

SCHA

10

Set LF (=10) as the end character.

TMRD

30

Set the READ timeout value to 30 seconds.

OPEN

1

Open channel 1.

READ

1

2

Read the character string from channel 1 to column 2 until
LF is read.

TRAN

1

99

Assign the return code to variable 1.

CLOS

1

Close the channel.

SLCT

Branch to the processing corresponding to each return
code.
(Note) Using a GOTO command to branch out of the

SLCT-EDSL syntax or to other branching
processing within the syntax is prohibited.

WHEQ

:

[1]

:

1

0

If the content of variable 1 is “0” (successful completion), [1]
will be performed. Accordingly, specify the processing to be
performed upon successful completion in [1].

WHEQ

:

[2]

:

1

1

If the content of variable 1 is “1” (timeout), [2] will be
performed. Accordingly, specify an appropriate processing
to be performed in [2], if necessary.

WHEQ

:

[3]

:

1

2

If the content of variable 1 is “2” (timer cancellation), [3] will
be performed. Accordingly, specify an appropriate
processing to be performed in [3], if necessary.

OTHE

:

[4]

:

If the content of variable 1 is other than “0,” “1” or “2,” [4]
will be performed. Accordingly, specify an error handling in
[4], if necessary.

EDSL

If any of the conditions was satisfied and the applicable
command has been executed as a result, the program will
proceed to this processing step.

Read completes successfully within 30 seconds

→ Variable No. 1 = 0

Timeout occurs

→ Variable No. 1 = 1

* The return code of READ command may not be limited to 0 or 1. The variable to store the

return code can be set in “Other parameter No. 24”. Refer to the explanation of READ
command for details.

This manual is related to the following products: