LabWindows/CVI

Table of Contents
  • LabWindows/CVI Fundamentals
  • Creating Applications
  • Distributing Applications
  • Library Reference
  • Programmer Reference
  • Hardware Information

CloseCom

int CloseCom (int portNumber);

Purpose

Closes a COM port.

CloseCom does nothing if the port is not open.

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
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

Examples

Refer to the following examples that use the CloseCom function:

  • rs232\commcallback.cws

    Open example
  • rs232\serial.cws

    Open example

Log in to get a better experience