Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

GetComConnectionState

LabWindows/CVI 8.5 Help
November 2007

NI Part Number:
370051K-01

»View Product Info

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 integer 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
state integer The current state of the port. A negative value indicates that an error occurred.

Value Description
0 No connection on this port.
1 Valid connection on this port.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit