Navigation:  thinBasic Modules > COMM >

COMM_Open

Previous pageReturn to chapter overviewNext page

 

Description

 

Opens a serial port to begin communications.

 

Syntax

 

COMM_Open(sComPort, hComm)

 

Returns

 

None

 

Parameters

 

Name

Type

Optional

Meaning

sCommPort

String

No

Identifies the serial port number, for example, "COM1", "COM4", etc.

hComm

Number

No

A number containing a free file number, typically provided by the COMM_FreeFile function.

 

Remarks

 

If the port was not opened successfully, the ERR will contain the error code.

Before actual communications through the port can commence, you must configure the communication parameters by using a COMM_Set statement for each parameter.

 

Restrictions

 

When opening ports above "COM9", Windows requires the port name to be specified using the following syntax:

 

COMM_Open("\\.\COM15", hComm)

 

See also

 

Examples

 

 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com