IAI America TT-C3 User Manual
Page 198
188
INTELLIGENT ACTUATOR
Chapter 4 Commands
2.
Explanation
of
Commands
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 (factory setting: variable 99) immediately after this command is executed.
Whether or not the command has been executed successfully can be checked by checking the return code. If necessary,
specify the processing to be performed when the command has been aborted due to an error.
Specifying “0” in operand 2 will execute a dummy read (clear the receive buffer and disable receive) (return code:
successful completion). The tool versions that support “0” input in operand 2 are shown below. Even if “0” cannot be input
from a tool, indirect specification is still available.
(Note) Dummy read (operand 2 = 0) is not supported by channel Nos. 31 to 34 (Ethernet option).
[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 (variable 99) to variable 1.
CLOS
1
Close the channel.
SLCT
The program branches to the processing corresponding to each return code.
(Note) Using a GOTO command to branch out of or into a SLCT-EDSL syntax
is prohibited.
WHEQ
[1]
1
0
If the content of variable 1 is “0” (successful completion), [1] will be executed.
Specify in [1] the processing to be performed upon successful completion.
WHEQ
[2]
1
1
If the content of variable 1 is “1” (timeout), [2] will be executed. If necessary,
specify the applicable processing in [2].
WHEQ
[3]
11
2
If the content of variable 1 is “2” (timer cancelled), [3] will be executed. If
necessary, specify the applicable processing in [3].
OTHE
[4]
If the content of variable 1 is not “0,” “1” or “2,” [4] will be executed. If necessary,
specify the applicable error handling in [4].
EDSL
If any of the conditions is satisfied and the corresponding command is executed,
the processing flow will move here.
:
(The remainder is omitted.)
:
x Return code of the READ command
The return code is stored in a local variable. The variable number can be set by “Other parameter No. 24.” The default variable
number is “99.”
0:
READ completed successfully (Receive complete)
1:
READ timeout (the timeout value is set by a TMRD command) (Continue to receive)
2:
READ cancelled due to timer (the waiting 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)