int ComSetEscape (int COMPort, int escapeCode);
Directs a 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 serial device driver defines the extended functions.
Not all device drivers support all escape codes. ComSetEscape returns Unknown System Error (-1) when the device driver does not support a particular escape code.
Input | ||
Name | Type | Description |
COMPort | integer | A number that indicates the COM port on which to operate. This number is paired with deviceName, which represents the COM port, during the OpenComConfig function call. Default Value: 1—COM1 Valid Range: 1—1,000 |
escapeCode | integer | The escape code of the extended function. Use the following values: CLRDTRClears the DTR (data-terminal-ready) signal. CLRRTSClears the RTS (request-to-send) signal. GETMAXCOMReturns the maximum COM port identifier the system supports. This value ranges from 0x00 to 0x7F, such that 0x00 corresponds to COM1, 0x01 to COM2, 0x02 to COM3, and so on. SETDTRSends the DTR signal. SETRTSSends the RTS signal. SETXOFFCauses the port to act as if it has received an XOFF character. SETXONCauses the port to act as if it has received an XON character. You can use the following values only with the National Instruments RS-485 serial driver: WIRE_4Sets the transceiver to four-wire mode. WIRE_2_ECHOSets the transceiver to two-wire DTR controlled with echo mode. WIRE_2_CTRLSets the transceiver to two-wire DTR controlled without echo. WIRE_2_AUTOSets the transceiver to two-wire auto TXRDY controlled mode. |
Name | Type | Description |
result | integer | The result of this function call. This code is a negative value that specifies the type of error that occurred. |