COMM_TRecv

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > COMM >

COMM_TRecv

 

Description

 

Receive binary data from a serial port within a certain time.

 

Syntax

 

RetValue = COMM_TRecv(hComm, NBytes, VariableBuffer, TimeOutInMS)

 

Returns

 

Number.

If function time out RetValue = -1 else RetValue = 0

 

Parameters

 

Name

Type

Optional

Meaning

hComm

Number

No

File number used by the COMM_OPEN statement to open the communications port.

NBytes

Number

No

The number of bytes to read from the open port.

VariableBuffer

Variable

No

A single string variable that will hold the received data from the serial port.

TimeOutInMS

Number

No

Time out in milliseconds

 

Remarks

 

Retrieve the NBytes number of bytes from hComm, placing the results in VariableBuffer.

Program execution will halt until NBytes bytes are available in the receiving queue or TimeOutInMS is reached.

 

Restrictions

 

See also

 

COMM_Recv

 

Examples