RS-232 Library Chapter 5
LabWindows/CVI Standard Libraries 5-14 © National Instruments Corporation
ComSetEscape
int result = ComSetEscape (int COMPort, int escapeCode);
Purpose
Directs the specified com port to carry out an extended function such as clearing or setting the
RTS signal line or setting the transceiver mode for RS-485. The extended functions are defined
by the serial device driver.
Not all device drives support all escape codes. Unknown System Error (-1) is returned when the
device driver does not support a particular escape code.
Note: This function is supported in the MS Windows version of LabWindows/CVI only.
Parameters
Input COMPort integer Range 1 through 32.
escapeCode integer Specifies the escape code of the extended
function.
Return Value
result integer Error Code. Refer to Table 5-6.
Parameter Discussion
The following values can be used for escape code.
CLRDTR—Clears the DTR (data-terminal-ready) signal.
CLRRTS—Clears the RTS (request-to-send) signal.
GETMAXCOM—Returns the maximum com port identifier supported by the system. This value
ranges from 0x00 to 0x7F, such that 0x00 corresponds to COM1, 0x01 to COM2, 0x02 to
COM3, and so on.
SETDTR—Sends the DTR (data-terminal-ready) signal.
SETRTS—Sends the RTS (request-to-send) signal.
SETXOFF—Causes the port to act as if an XOFF character has been received.
SETXON—Causes the port to act as if an XON character has been received.