IAI America ASEL User Manual

Page 227

Advertising
background image

Part 2 Programs

Chapter 3 Explanation of Commands

205

Part 2 Programs

z

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

0

Open channel 0.

WRIT

0

2

Write the character string in column 2 to channel 0

until LF is written.

CLOS

0

Close the channel.

Once the channel has been opened, a WRIT command can be executed (data can be sent)

for other tasks besides the one that opened the channel. Accordingly, if a READ command is

executed for a channel-opening task and then a WRIT command is executed for other task,

the response from the other side can be received without delay after the applicable data is

sent from the PSEL.

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: 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 ~ 4: For future expansion

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)

Advertising