National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 5 RS-232 Library
© National Instruments Corporation 5-15 LabWindows/CVI Standard Libraries
The following values may be used only with the RS-485 serial driver developed by National
Instruments:
WIRE_4—Sets the transceiver to Four Wire Mode.
WIRE_2_ECHO—Sets the transceiver to Two Wire DTR controlled with echo mode.
WIRE_2_CTRL—Sets the transceiver to Two Wire DTR controlled without echo.
WIRE_2_AUTO—Sets the transceiver to Two Wire auto TXRDY controlled mode.
ComToFile
int
nbytes = ComToFile
(int
COMPort
,
int
fileHandle
,
int
count
,
int
terminationByte
);
Purpose
Reads from input queue of specified com port and write data to file specified by
fileHandle
.
Returns number of bytes successfully written to file. Bytes are read from input queue until
count
is satisfied,
terminationByte
is encountered, or an error occurs, whichever occurs first.
Parameters
Input
COMPort
integer Range 1 through 32.
fileHandle
integer File handle returned by
OpenFile.
count
integer If 0, this value is ignored.
terminationByte
integer If -1, this value is ignored.
Return Value
nbytes
integer Number of bytes written to the
file.
Parameter Discussion
If
count
is zero, the function ignores it and terminates on
terminationByte
or error.
If
terminationByte
is -1, the function ignores it and terminates on
count
bytes read or an error.
If
terminationByte
is valid, the function stops when it encounters
terminationByte
.
terminationByte
is removed from the input queue and is not written to the file. If
terminationByte
is CR or LF, then CR-LF and LF-CR combinations are treated just as they are