RS-232 Library Chapter 5
LabWindows/CVI Standard Libraries 5-8 © National Instruments Corporation
– If the input queue of the port is nearly full, the library lowers RTS and DTR.
– If the input queue of the port is nearly empty, the library raises RTS and DTR.
– If the port is closed, the library lowers RTS and DTR.
• When the PC is the sender:
– The RS-232 library must detect that its CTS line is high before sending data out the port.
Note: The only difference between LWRS_HWHANDSHAKE_CTS_RTS and
LWRS_HWHANDSHAKE_CTS_RTS_DTR is the behavior of the DTR line.
If the handshaking mechanism used by your device uses the CTS and RTS lines, use a serial
cable as shown in Table 5-3 if your device is a DCE, or Table 5-4 if your device is a DTE.
Optionally, your cable can omit the connection between pins 6 and 20 if your device does not
monitor DSR when sending data. Notice that the RTS pin of the receiver translates to the CTS
pin of the sender, and the DSR pin of the receiver translates to the DTR pin of the sender.
If you want to use hardware handshaking but your device uses a different hardware handshake
protocol than the ones described here, you can build a cable that overcomes the differences. You
can construct a cable to serve your special needs be referencing the pin description in Table 5-2.
RS-232 Library Function ReferenceThis section describes each function in the LabWindows/CVI RS-232 Library. The
LabWindows/CVI RS-232 Library functions are arranged alphabetically.
CloseCom
int result = CloseCom (int COMPort);
Purpose
Closes a COM port.
Parameter
Input COMPort integer Range 1 through 32.
Return Value
result integer Refer to error codes in
Table 5-6.