LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA local memory MEMACC

I am looking for a way to test a cPCI DMA controller by having it write to local memory that has been allocated through VISA. The help files for the VISA VIs indicate that local memory can be setup with MEMACC, but never explain how this is done. Essentially I need the local memory to act as a device with an address that I can send the DMA so that it can transfer it's data. System is Windows 2000, Labview 6.1, MXI-3, DUT using DMA transfers.
0 Kudos
Message 1 of 4
(3,861 Views)
Thank you for using our Developer Zone for your service question! I have looked thoroughly at the manuals for our VISA v2.6 and I have not seen where it describes using MEMACC in order to allocate local memory space to use like an object. So, I have some questions. It would help me to know exactly where you saw the information stating that this was a supported application in VISA. Also, I would like to know if you are trying to access memory on the cPCI DMA controller or actually in the computer itself. It is possible, using PXI MEMACC functions, to write to and read from allocated parts of PXI and cPCI equipment's memory. If this is what you desire to do, I can send you further information rgarding this feature. If you are trying to access local computer mem
ory, I do not believe this is a supported function. But if you show me the documentation that hints this is possible I would like to research this for you. Thanks!

Anthony Bacak
National Instruments
Applications Engineering
0 Kudos
Message 2 of 4
(3,861 Views)
I think it came down to interpretation. Here is the
description in question:
----------------------------------------------------
VISA Memory Allocation Details
The memory can be allocated on either the device itself or on the computer's system memory. If the device to which the given VISA Session refers is located on the local interface card, the memory can be allocated either on the device itself or on the computer's system memory. The memory region referenced by offset that is returned from this function can be accessed with the high-level functions VISA Move In 8, VISA Move In 16, VISA Move In 32, VISA Move Out 8, VISA Move Out 16, and VISA Move Out 32 or it can be mapped using the VISA Map Address function. This function is includ
ed in both the High Level Register Access and Low Level Register Access subpalettes.
-------------------------------------------------------

This description is taken from the High Level Register
Access Help File for VISA Memory Allocation. It describes the allocated memory as either being on a device or in local memory.

I was hoping to be able to create a device in local memory with VISA Mem Allocate, but I guess that doesn't work. At this time I am looking into Windows API functions (HEAPCreate) to create my memory space. The problem is getting Labview to recognize this space so I can send the memory address to the DMA.
0 Kudos
Message 3 of 4
(3,861 Views)
We documented this a little better for NI-VISA 3.0. Yes, you can do this from any environment, including LabVIEW.

Open the resource "PXI::MEMACC". Call VISA Mem Alloc with the buffer size you need. NI-VISA will allocate a physically contiguous locked buffer of that size, and return the physical PCI address as the "offset" return value. Write that address into your device's DMA register as the target address. Then to read the results, call VISA Move In 8/16/32 on address space 9 (VI_PXI_ALLOC_SPACE) with that same offset.

Dan Mondrik
National Instruments
0 Kudos
Message 4 of 4
(3,861 Views)