National Instruments 320682C Musical Toy Instrument User Manual


 
RS-232 Library Chapter 5
LabWindows/CVI Standard Libraries 5-12 © National Instruments Corporation
ComRdByte
int
byte = ComRdByte
(int
COMPort
);
Purpose
Reads a byte from the input queue of the specified port. Returns an integer whose low-order byte
contains the byte read. Returns either on time-out, when the byte is read, or when an error occurs.
If an error or a time-out occurs, ComRdByte returns a negative error code. See Table 5-6. This is
the only case in which the high-order byte of the return value is non-zero.
Parameter
Input
COMPort
integer Range 1 through 32.
Return Value
byte
integer Low order byte contains the
byte read.
<0
Error.
Using This Function
This function times out if the input queue remains empty in the specified time-out period. This
may occur when no data has been received within the time-out period.
The function returns an error code if the port is not open,
COMPort
is invalid, or a time-out
occurs.
ComRdTerm
int
nbytes = ComRdTerm
(int
COMPort
,
char
buffer
[],
int
count
,
int
terminationByte
);
Purpose
Reads from input queue until
terminationByte
occurs in
buffer
,
count
is met, or a time-out
occurs. Returns integer value indicating number of bytes read from queue.