
281
Part 4 Commands
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 a timeout value used with a READ/WRIT 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 (variable 99
based on the factory setting) that will be stored in a local variable immediately after the
READ command is executed.)
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
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.
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.
The timer setting specified in operand 2 sets the timeout value (maximum time to wait
for completion of send) to be applied when a WRIT command is executed (= maximum
time to wait for send based on flow control).
The WRIT timer setting is effective only for standard SIOs (channel 1 or 2 supporting
flow control).
The timer setting specified in operand 2 sets the timeout value (maximum time to wait
for completion of send) to be applied when a WRIT command is executed (= maximum
time to wait for send based on flow control) (arbitrary).
The WRIT timer setting is effective only for standard SIOs (channel 1 or 2 supporting
flow control).
TMRD used in the X-SEL-JX/KX type controller is treated as TMRW in the X-SEL-
PX/QX type controller. If a program file created for an X-SEL-JX/KX controller is
transferred to an X-SEL-PX/QX controller, the PC software will automatically convert
“TMRD” to “TMRW” before the file is transferred.
282
Part 4 Commands
WRIT (Write)
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 WRIT Channel
number
Column
number
CC
(NOTE 1)
[Function] Write the character string in the column specified in operand 2 to the channel specified in
operand 1.
The operation will end when the character specified by a SCHA command is written.
Either a local or global column can be specified.
[Example]
SCHA
10
Set LF (= 10) as the end character.
OPEN
1
Open channel 1.
WRIT
1
2
Write the character string in column 2 to channel 1 until
LF is written.
CLOS
1
Close the channel.
As long as a standard SIO port (channel 1 or 2) is open, a task other than the one that
opened the port can be used to execute (send) a WRIT command. Accordingly, if a READ
command is executed in a port-opening task and then a WRIT command is executed in
other task, the response from the other side can be received without delay after the
command is sent from the X-SEL.
(Note 1)
CP for channels other than 1 and 2.
Return code of the WRIT command (channels 1 and 2 only)
The return code is stored in a local variable. Variable number can be set by “Other parameter No. 24.” The
default variable number is 99.
0: WRIT completed successfully
1: WRIT timeout (the timeout value is set by a TMRW command)
2: WRIT timer cancelled (the wait status is cancelled by a TIMC command)
3 and 4: For future extension
5: WRIT factor error (program abort error) (cannot be recognized by SEL commands)
6: WRIT task ended (program end request, etc.) (cannot be recognized by SEL commands)
285
Summary of Contents for X-SEL PX
Page 1: ...Operation ManualSeventh Edition X SEL Controller PX QX Type Tenth Edition ...
Page 2: ......
Page 8: ......
Page 14: ......
Page 410: ...383 Appendix 386 ...
Page 452: ...425 Appendix 5 428 ...
Page 559: ......