Call VXImemAlloc() or viMemAlloc()

NI-VISA Measurement & Automation

Call VXImemAlloc() or viMemAlloc()

Note  National Instruments recommends using NI-VISA, rather than the NI-VXI API, to develop your applications.

VXImemAlloc or viMemAlloc fail if it cannot allocate and lock down the amount of physical memory you request in the size parameter. If you are using shared memory, you can check these settings by right-clicking on your external controller or VXIpc embedded controller and selecting Hardware Configuration. The system on which you are sharing memory must not be set to A16 only. You can share system memory only in A24 or A32 space. The amount of memory you are sharing should be set large enough to handle all the memory you may want to allocate.

The amount of memory that you are sharing must be greater than the amount you are trying to allocate with VXImemAlloc() or viMemAlloc(). You must also reserve an amount of memory equal to or greater than the amount you are trying to allocate by setting the Reserve physical memory field in the Shared Memory page.

There is sample code that shows how to use VXImemAlloc and viMemAlloc(). The NI-VISA sample code is in the vxipnp\win32\Nivisa\examples directory and is called ShareSys.c. The NI-VXI API code, VXImem.c, is in the nivxi\win32\msc(borlandc)\examples\ directory.

Note  Not all controllers support shared memory. For more information about shared memory support, refer to the documentation for your controller.