SetXMode
- Updated2023-02-21
- 2 minute(s) read
SetXMode
int SetXMode (int portNumber, int mode);
Purpose
Enables or disables software handshaking by enabling or disabling XON/XOFF sensitivity on transmission and reception of data.
By default, XON/XOFF sensitivity is disabled.
SetXMode returns an error if you have not opened the port or if you pass an invalid parameter value.
![]() |
Note LabWindows/CVI passes the input queue size and output queue size information from the OpenComConfig function to the Windows serial driver. However, the Windows serial driver might use a different number for the actual queue size. Because the driver sends the XOFF and XON characters based on the actual queue size, the driver might not transmit an XOFF or XON character when you expect. |
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 |
||
mode | int | Specify a nonzero value or select enable in the function panel to enable XON/XOFF sensitivity for the selected port. Specify 0 or select disable in the function panel to disable XON/XOFF sensitivity for the selected port.
|
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 3.0 and later
Example
Refer to rs232\serial.cws for an example of using the SetXMode function.