IAI America XSEL-KE User Manual

Page 210

Advertising
background image

195

Part 4 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. You can
check if the command has been executed successfully by checking this return code. If necessary, specify each processing to be
performed when the command fails.
,IWKHPDLQDSSOLFDWLRQYHUVLRQLVRUODWHUVSHFLI\LQJ³LQRSHUDQGZLOOH[HFXWHDGXPP\UHDG FOHDUWKHUHFHLYHEXIIer and
disable receive) (return code: successful completion). The tool

YHUVLRQVWKDWVXSSRUW³´LQSXWLQRSHUDQGDUHVKRZQEHORZ(ven if

³´FDQQRWEHLQSXWIURPDWRROLQGLUHFWVSHFLILFDWLRQLVDYDLODEOH
x PC software version 1.1.1.0 or later
x Teaching-pendant application version 1.06 or later
(Note) Dummy read cannot be specified (= operand 2 cannot be

VHWWR³´ IRUFKDQQHO1RVWR (WKHUQHWRSWLRQ  

[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) Branching out of or into a SLCT ~ EDSL statement using a

GOTO command is prohibited.

WHEQ

1

0

If the content of variable 1 is

³´ H[HFXWHGVXFFHVVIXOO\ >@ZLOOEH

executed. Specify in [1] the processing to be performed when the
command has been executed successfully.


[1]

WHEQ

1

1

If the content of variable 1 is

³´ WLPHRXW >@ZLOOEHH[HFXWHG,I

necessary, specify in [2] the processing to be performed in this
condition.


[2]

WHEQ 1

2

,IWKHFRQWHQWRIYDULDEOHLV³´ WLPHUFDQFHOOHG >@ZLOOEHH[HFXWHG,I
QHFHVVDU\VSHFLI\LQ>@WKHSURFHVVLQJWREHSHUIRUPHGLQWKLV
condition.





>@

OTHE

,IWKHFRQWHQWRIYDULDEOHLVQRW³´³´RU³´>@ZLOOEHH[HFXWHG,I
necessary, specify in [4] the error handling to be performed in this
condition.


[4]

EDSL

If any of the above conditions is satisfied and the applicable command is
executed, the processing will move here.



(snip)



x Return code of the READ command

The return code is stored in a local variable. If the main application version is 0.21 or later, variable number can be set by

³2WKHUSDUDPHWHU

1R´7KHGHIDXOWYDULDEOHQXPEHULV
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 cancelled due to timer (the waiting status was
cancelled by a TIMC command) (Continue to receive)



5($'6&,)RYHUUXQHrror (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)

Advertising
This manual is related to the following products: