LabWindows/CVI

Content Type
Programming Language
Current manual

ComSetEscape

int ComSetEscape (int portNumber, int escapeCode);

Purpose

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.

Parameters

Input
Name Type Description
portNumber int A number that indicates the COM port on which to operate.

This number maps to the COM port specified by deviceName in the call to OpenCom or OpenComConfig. The portNumber 1, for example, may not necessarily map to COM1.

(Linux) The portNumber 1, for example, may not necessarily map to /dev/ttyS0.

Valid Range: 1—1,000
escapeCode int The escape code of the extended function. Use the following values:

Note   If you enable hardware handshaking, you cannot specify the CLRDTR, CLRRTS, SETDTR, or SETRTS values.
CLRDTR—Clears the DTR (data-terminal-ready) signal.

CLRRTS—Clears the RTS (request-to-send) signal.

SETDTR—Sends the DTR signal.

SETRTS—Sends the RTS signal.

SETXOFF—Causes the port to act as if it has received an XOFF character.

(Linux) This value is not supported.

SETXON—Causes the port to act as if it has received an XON character.

(Linux) This value is not supported.

You can use the following values only with the National Instruments RS-485 serial driver:

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.

Return Value

Name Type Description
returnValue int The result of this function call. This code is a negative value that specifies the type of error that occurred.

Additional Information

Library: RS-232 Library

Include file: rs232.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Was this information helpful?

Previous

ComBreak

Next

Status

Previous

ComBreak

Next

Status

Log in to get a better experience