Chapter 5 RS-232 Library
© National Instruments Corporation 5-13 LabWindows/CVI Standard Libraries
Parameters
Input COMPort integer Range 1 through 32.
count integer If 0, no bytes are removed from
queue.
terminationByte integer Low byte contains the numeric
equivalent of the terminating
character.
Output buffer string The buffer in which to store the
data.
Return Value
nbytes integer Number of bytes read from the
input queue.
Using This Function
This function times out if the input queue remains empty within the specified time-out period.
This may occur when no data has been received during the time-out period. If the read
terminates on the termination byte, the byte is neither written to the buffer nor included in the
count.
If the termination character is either a carriage return (CR or decimal 13) or a linefeed (LF or
decimal 10), the function handles it as follows:
• If terminationByte = CR, and if the character immediately following CR is LF, discard the
LF in addition to the CR.
• If terminationByte = LF, and if the character immediately following LF is CR, discard the
CR in addition to the LF.
Only the bytes placed in buffer are included in the return count. If CR or LF is discarded
because it follows an LF or CR, it is not counted toward satisfying the count.
The function returns an error if the port is not open or parameter values are invalid.