viMemAllocEx

Agilent VISA.NET

viMemAllocEx

Syntax

viMemAllocEx(ViSession vi, ViBusSize sizeViBusAddress64 offset64);   [VISA 4.0 and later]

Description

Note: viMemAllocEx is implemented for PXI MEMACC resources only. It is not implemented for VXI and VXI-GPIB MEMACC resources.

The offset returned for a PXI MEMACC resource is an absolute physical address of a contiguous block of memory which has been allocated by the operating system. The memory block is also locked, meaning it will not be swapped out. A common use for this memory is to do user-mode DMA to or from a PXI device..

Both the high-level memory access functions (viInXX, viOutXX, viMoveXX) and the low-level memory access functions (viMapAddress, viPeekXX, viPokeXX, viUnmapAddress) can be used on MEMACC sessions to access the allocated memory.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

size

IN

ViBusSize

Specifies the size of the allocation.

offset64

OUT

ViBusAddress64

Returns the 64-bit offset of the allocated device memory.

Return Values

Type ViStatus

This is the function return status. It returns either a completion code or an error code as follows.

Completion Code

Description

VI_SUCCESS

Operation completed successfully.

Error Codes

Description

VI_ERROR_ALLOC

Unable to allocate shared memory block of the requested size.

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

The given session or object reference is invalid (both are the same value).

VI_ERROR_INV_SIZE

Invalid size specified.

VI_ERROR_MEM_NSHARED

The device does not export any memory.

VI_ERROR_NSUP_OPER

The given vi does not support this operation.

VI_ERROR_RSRC_LOCKED

Specified operation could not be performed because the resource identified by vi has been locked for this kind of access.

See Also

viMemFreeEx