Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Must the buffer pointed in calls to WFM_DB_Transfer be at the same address?

We have a need to produce a dynamically changing output signal. Double Buffering looked promising to achieve this.

From trial and error it appears that the address pointed to from WFM_Load must be used in WFM_DB_Transfer. We hoped to have multiple buffers and change the output by pointing to the desired buffer in calls to WFM_DB_Transfer. When this was attempted the first buffer change worked but successive buffer changes had no impact and it continued to output the second buffer.

When we copied the desired buffer to a fixed buffer referenced in WFM_Load and WFM_DB_Transfer than all worked as expected. This has led us to conclude that the buffer address must be fixed. This is dissa
ppointing because otherwise unecessary memory copies are taking place.

Is this correct? If so is the same true of the size specified in WFM_DB_Transfer calls. We want the size to be able to vary because the algorithms used to determine the levels needed for the desired frequencies varies the buffer size in an effort to ensure that buffers can transition at the same phase.

Any help would be appreciated,
Jack
0 Kudos
Message 1 of 6
(7,790 Views)
Jack;

You are correct on your considerations. Unfortunately, you need to use the same memory position for both Load and Transfer calls. You will need to make the size don't vary and use the same memory area, if you need to change the waveform on the fly.
I'm attaching a CVI code which uses those same function calls to change the waveform output on the fly. You can use that code as future reference.
Hope this helps.
Filipe
0 Kudos
Message 2 of 6
(7,790 Views)
Can the waveform by changed on the fly by writing to the memory locations of the buffer array being used for waveform generation at any time or does DFM_DB_HalfReady have to be used along with a call to WFM_DB_Transfer (or WFM_Load) ? i.e. does NIDAQ move the buffer specified in WFM_Load to some other host computer memory location (that is inaccessible to the user) and then transfer from that other memory location to the board ?

Help on WFM_Load says "You can make repeated calls to WFM_Load to change the shape of a waveform in progress". After the first call to WFM_Load, do I have to call it again to change the waveform or can just the buffer memory contents be changed ?
What is the difference between using WFM_Load and WFM_DB_Transfer to change during
generation ?

WFM_Load says FIFO cannot be used if the buffer size is greater than the board's FIFO. Why ? Can't the board use DMA and transfer part of the host buffer into its FIFO as needed ?
0 Kudos
Message 3 of 6
(7,790 Views)
Is this still true in NIDAQ Version 7 and DAQmx ?
0 Kudos
Message 4 of 6
(7,790 Views)
Jack,

Adlink makes multi-channel AO cards, DAQ-2501 and 2502, whose continuous output waveforms I've been able to change on the fly by just changing values in the raw data array using Delphi and their DLL. I could change a small portion of the wavefrom array somewhere in its middle. These changes are observed on the next iteration cycle. No need to perform some function call to transfer raw data from your user array to some intermediate driver buffer. They also have an Active X and LabVIEW driver.

http://www.adlinktech.com/products/DataAcquisition.html

Steve
0 Kudos
Message 5 of 6
(7,790 Views)

Hi Filipe,

 

Could you explain... why WFM_DB_Transfer called twice in your example ?

 

 

I'm using the same code and additional call of  WFM_DB_Transfer take additional time, but without it not work well... strange.

 

TIA.

0 Kudos
Message 6 of 6
(6,915 Views)