<<

Contents

Search

>>

 

OPENCOMM$

 

 

Function

 

 

Syntax:

OPENCOMM$(<Interface>,<Parameter>,<Size Receiving Buffer>)

 

<Interface>

= <STRING-EXPRESSION>

<Parameter>

= <STRING-EXPRESSION>

<Size Receiving Buffer>

= <NUM-EXPRESSION>

 

 

Meaning:

Opens a serial port.

 

OPENCOMM$ returns a string that contains, separated by semi-colons, the error code and the file number of the opened interface. The error code is 0 if the interface could be opened successfully, otherwise –1. The file number is needed for the commands READCOMM$, WRITECOMM$ and CLOSECOMM.

 

Parameter:

Interface

Name of interface (e.g. "COM1")

Parameter

Parameters of interface separated by comma:

Baudrate, Parity, Data bits, Stop bits.

Size Receiving Buffer

Size of receiving buffer in Bytes

 

Sample:

H$ = OPENCOMM$("COM1","9600,n,8,1",1024)

RET% = VAL(SUBSTR$(H$,";",1))

FILENR% = VAL(SUBSTR$(H$,";",2))

IF RET% <> 0

THEN ... Error ...

ENDIF

 

See also:

READCOMM$

WRITECOMM$

CLOSECOMM