VxiReceive Procedure

Reads bytes from a specified VXI Message Based device.

Syntax

[ lStatus = ] VxiReceive ( lLA, sEOS, bEND, lTimeout [, enMode] , pDst [, lBytes ] )

The VxiReceive procedure syntax has the following parts:

 

Name

Type

Description

lStatus

Long

Bytes actually received

lLA

Val Long

Device logical address

sEOS

Val BString

End of sequence string

bEND

Bool

A Boolean expression specifying whether or not to terminate the transmission upon the End bit.

lTimeout

Val Long

Timeout in milliseconds

enMode

Val enumAIoMode

Input read mode. The deafult is 0, aioDefault.

pDst

Var Any

Receive data buffer

lBytes

Val Long

Maximum number of bytes to receive. If the default value is used (-1) the byte length of the pDst is used as the maximum of bytes to receive.

Where

bEND can have one of the following values:

 

Value

Description

True *

Terminate the transmission upon the END bit.

False

The END bit is ignored (similar to GPIB EOI).

enumAIoMode can have one of the following values:

 

Name

Value

Description

aioImmediate

0 *

Receive on data available

aioWaitGpibSrqVxiDor

1

Receive on Srq (gpib) or on Dor (vxi)

aioGpibImmediateOrSrq

2

Receive on Immediate or Srq (gpib)

aioDisableBstrConvert

4

Disable conversion of BString to String, can be combined with 1 of the previous values.

Comments

The lLA contains the logical address of the device and may be obtained using the GetDriverAddress function.

The sEOS can be 0-2 bytes long and specifies the data bytes that signal the end of data (terminator).

If lBytes is not given (-1), then it is set to the length of the data buffer.

This function returns the number of bytes received. A value of -1 indicates failure.

Example

The following command reads data device to the string sData at Logical Address 19. The timeout is set to 1500 mSec, the terminator used is Line Feed:

VxiReceive(19, "\n", True, 1500, ,sData)

See Also

VxiSend