GetComConnectionState
- Updated2023-02-21
- 1 minute(s) read
int GetComConnectionState (int portNumber);
Purpose
Returns the connection state of the specified port.
(Linux) This function is not supported.
GetComConnectionState returns an error if you have not opened the port or if you pass an invalid value for portNumber.
![]() |
Note This function works only with NI Serial hardware. The function returns an Unknown System Error with other hardware ports. |
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 |
Return Value
| Name | Type | Description | ||||||
| connectionState | int | The current state of the port. A negative value indicates that an error occurred.
|
Additional Information
Library: RS-232 Library
Include file: rs232.h
LabWindows/CVI compatibility: LabWindows/CVI 7.1 and later
