
279
Part 4 Commands
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:
PC software: Version 1.1.1.0 or later
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.
280
Part 4 Commands
(Note 1)
A READ command must have been executed before the other side sends the end
character.
(Note 2)
Dummy read specification (operand 2: 0) is not supported by channel Nos. 31 to 34
(Ethernet option).
SCHA 10
OPEN 1
READ 1
2
Other side
CLOS
1
Return code of the READ command
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.
The variable number is fixed to 99 in main application version 0.20 and earlier.
0: READ completed successfully (Receive complete)
1: READ timeout (the timeout value is set by a TMRD command) (Continue to receive)
2: READ timer cancelled (the wait status was cancelled by a TIMC command) (Continue to
receive)
3: READ SCIF overrun error (Receive disabled)
4: READ SCIF receive error (framing error or parity error) (Receive disabled)
5: READ factor error (program abort error) (Receive disabled)
(Cannot be recognized by SEL commands)
6: READ task ended (program end request, etc.) (Receive disabled)
(Cannot be recognized by SEL commands)
7: READ SCIF receive error due to other factor (Receive disabled)
8: READ expanded-SIO overrun error (Receive disabled)
9: READ expanded-SIO parity error (Receive disabled)
10: READ expanded-SIO framing error (Receive disabled)
11: READ expanded-SIO buffer overflow error (Receive disabled)
12: READ expanded-SIO receive error due to other factor (Receive disabled)
13 to 20: Used only in Ethernet communication (optional)
21: READ SIO temporary receive QUE overflow error (Receive disabled)
22: READ SIO slave receive QUE overflow error (Receive disabled)
282
Содержание X-SEL PX
Страница 1: ...Operation ManualSeventh Edition X SEL Controller PX QX Type Tenth Edition ...
Страница 2: ......
Страница 8: ......
Страница 14: ......
Страница 39: ...15 Part 1 Installation Reference Circuit Diagram Surge absorber Solenoid valve Controller 0 V 15 ...
Страница 410: ...383 Appendix 386 ...
Страница 452: ...425 Appendix 5 428 ...
Страница 559: ......