Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Access to locked buffer while DMA active: viMoveIn32 or viMapAddress?

Hi all,

 

I'm using double-buffering DMA to transfer data into half of a locked buffer I allocated using viMemAlloc(...)

 

I want to process the first block of DMA data while the other half is being DMA'd in.

 

The tutorial (http://zone.ni.com/devzone/cda/tut/p/id/3251) suggests that I should be copying the whole buffer out to user memory using viMoveIn32(..., VI_PXI_ALLOC_SPACE, ...)

 

It seems like an unnecessary step when I can simply get a pointer to the buffer using viMapAddress.

 

Having said that, it seems that if I use the viMapAddress method once every few million DMA transfers my PC crashes with a blue screen of death.

 

Any suggestion why that should be happening?

 

Carlo

 

 

0 Kudos
Message 1 of 3
(3,352 Views)

Hello Carlo,

 

Can you please provide some more information regarding the versions software that you are using and the hardware that makes up your system.

 

Kind regards,

Daniel T
Account Manager
National Instruments UK & Ireland
0 Kudos
Message 2 of 3
(3,337 Views)

Hi Daniel,

 

I'm using NI-VISA 4.6, our system uses a PLX 9056 device to implement the PCI interface and we DMA data by having the 9056 take control of the bus and write to a locked buffer as suggested in the tutorial above.

 

Looking better at what the code now does,I copied to a user buffer before a new DMA transaction is kicked off while before I had concurrent access to the locked buffer from the next DMA transaction and from the user threads (using a pointer provided by viMapAddress).

 

Carlo

0 Kudos
Message 3 of 3
(3,334 Views)