National Instruments 320682C Musical Toy Instrument User Manual


 
RS-232 Library Chapter 5
LabWindows/CVI Standard Libraries 5-18 © National Instruments Corporation
Parameter Discussion
This function times out if the output queue has not been updated in the specified time-out period.
This can occur if the output queue is full and no further data can be sent because XON/XOFF is
enabled and the device has sent an XOFF character without sending the follow-on XON
character. It can also occur if Hardware Handshaking is enabled and the Clear To Send (CTS)
line is not asserted.
Bytes are sent from the output queue to the serial device under interrupt control without program
intervention. If you close the port before all bytes have been sent, you lose the bytes remaining in
the queue. To guarantee that all bytes have been removed from the output queue before closing
the port, call GetOutQLen. GetOutQLen returns the number of bytes remaining in the output
queue.
The function returns an error if the port is not open or parameter values are invalid.
FlushInQ
int status = FlushInQ (int COMPort);
Purpose
Removes all characters from the input queue of the specified port.
Parameter
Input
COMPort
integer Range 1 through 32.
Return Value
status
integer Refer to Error Codes in
Table 5-6.
Using This Function
You can use this function to flush a flawed transmission in preparation for re-transmission. It
alleviates the need to read bytes into a buffer to empty the queue. If the queue is already empty,
this function does nothing.
The function returns a negative error code if the port is not open or if COMPort is invalid.