Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Arbitrary Waveform Generation

I have been unsuccessful in finding examples of how to do this using the NIDAQ libraries. I have seen a continuous waveform generation example using WFM_DB_Transfer, but none that change the buffer in-between half-buffer transfers. I cannot seem to get my program to work I seem to be combining old data with new after a few cycles.

Has anyone done this?
0 Kudos
Message 1 of 2
(2,425 Views)
I use Measuremment Studio 6 with Delphi 7. I use CWAO1.Write(wfm) to
try and change the data in a continuously generating waveform. NIDAQ
seems to keep an internal index of the position in its internal memory
buffer of the last array index to which you have written waveform
data. The next write to NIDAQ's waveform data occurs at that index.
So if you have a 1000 point waveform array and write 500 points using
CWAO1.Write(wfm), the next time you call CWAO1.Write(wfm), those new
points go in at index 501. If you write 200 points the first time,
the next write goes in at index 201. The problem for me is that if I
wish to arbitrarily change only a small portion of the waveform, I
must write the entire waveform every time so that the index cycles
around to where I
want it to be. i.e. If I wish to change wavefrom
values from index 700 to 800 and I am at index 700 and I write 100 new
values, I cannot just go again and write 100 new values for the next
change. Those next 100 values would go in at index 801 to 900. I
must instead write 900 more values to get the index to cycle around
again to 700.

It seems NIDAQ uses its own internal memory buffer from which to
output waveform data. You cannot make arbitrary waveform changes by
simply changing values in a local host memory array such as declaring
my_wfm[700] := 836; You must use CWAO1.Write(wfm) to pass a portion
of the local host memory waveform array to NIDAQ's internal memory. I
have used other vendors waveform generator cards which do access the
local compiler's waveform memory values directly and such small
portion waveform changes are possible.

> I have been unsuccessful in finding examples of how to do this using
> the NIDAQ libraries. I have seen a continuous waveform generation
> ex
ample using WFM_DB_Transfer, but none that change the buffer
> in-between half-buffer transfers.
0 Kudos
Message 2 of 2
(2,425 Views)