Input Character Or Line From The Rs-232 Port; Output Character Or Line To The Rs-232 Port; Reading The Port Status - Yamaha Mio Service Manual

Hide thumbs Also See for Mio:
Table of Contents

Advertisement

Input Character or Line From the RS-232 Port

Syntax
GET #IOCB,varb
INPUT #IOCB,varb$
Remarks
These functions input data from the RS-232 port; the GET statement inputs the numeric value of one
character into a numeric variable and the INPUT statement inputs a string of characters into a string
variable. On the INPUT statement, if the data is a numerical ASCII string, you may read the data into
a numeric variable. Input strings are terminated by an end-of-line (EOL) character.
Note that the IOCB must be opened for read or read/write (modes 4 or 12), but whether in
concurrent mode or not has no effect on GET/INPUT statement operation. Refer to your BASIC
reference manual for more information on these statements.

Output Character or Line To the RS-232 Port

Syntax
PUT #IOCB,exp
PRINT #IOCB;exp$
Remarks
These functions output data to the RS-232 port; the PUT statement outputs the numeric value of one
character to the port, and the PRINT statement outputs a string of characters to the port. The syntax
of the PRINT statement is the same as a normal PRINT statement except that the "#IOCB;"
precedes the expression.
Note that the IOCB must be opened for write or read/write (mode 8 or 12), but whether in concurrent
mode or not has no effect on GET/INPUT statement operation. Refer to your BASIC reference
manual for more information on these statements.

Reading the Port Status

Syntax
STATUS #IOCB,DUMMY
FLAGS = PEEK(746) : REM Error bits relating to status history
LINESTAT = PEEK(747) : REM Status of handshake lines
or
STATUS #IOCB,DUMMY
FLAGS = PEEK(746) : REM Error bits relating to status history
INCHARS = PEEK(747) : REM Number of chars in input buffer
OUTCHARS = PEEK(749) : REM Number of chars in output buffer
Remarks
These statement sequences are useful for determining many facts about the state of the RS-232
port. The first syntax is used when in pseudo "block mode I/O" (same as "non-concurrent"), whereas
the second is used in concurrent mode I/O. Notice that the variable DUMMY is simply a CIO status
of the success of the STATUS command. If there were an error (DUMMY<>1), then BASIC would
halt and give an error message (unless a TRAP was performed prior to the STATUS).
The block mode STATUS (first syntax) returns a status history of the port (in FLAGS) and the state
MIO Service Manual
Page 66

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents