National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 5 RS-232 Library
© National Instruments Corporation 5-17 LabWindows/CVI Standard Libraries
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.
Example
/* Place the string "Hello, world!" in the output queue of */
/* COM2 and check if operation was successful. */
if (ComWrt (2, "Hello, World!", 13) != 13)
/* Operation was unsuccessful */;
or
char buf[100];
Fmt(buf,"%s","Hello, World!");
if (ComWrt (2, buf, 13) != 13)
/* Operation was unsuccessful */;
ComWrtByte
int status = ComWrtByte (int COMPort, int byte);
Purpose
Writes a byte to the output queue of the specified port. The byte written is the low-order byte of
the integer. Returns a 1 to indicate the operation is successful, or a negative error code to indicate
the operation has failed. Returns immediately without waiting for the byte to be transmitted out
through the serial port.
Parameters
Input
COMPort
integer Range 1 through 32.
byte
integer Only the low-order byte is
significant.
Return Value
status
integer Result of the write operation.
<0
Error code; See Table 5-6.
1
One byte placed in the output
queue.