LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

M 6259 FIFO analog out

I need multitone sine signal with frequency from 100kHz to 600kHz. 4 samples per period is OK, so it must be possible with FIFO, but I can't found any info which function in NIDAQmx to use. I have CVI 7.1
Where to find any help what to do to fill FIFO with let say 5 sine signal each one with n period and to run continuous Analog out from that FIFO.
0 Kudos
Message 1 of 13
(4,876 Views)
Hi Oldi,

A good example to begin with in CVI7.1 is the "ContGen-IntClk.prj". You can find it under:
Help >> Find Examples
Under the "Browse" tab, go to Hardware Input and Output >> DAQmx >> Analog Output >> Voltage

This program outputs the chosen waveform on one channel. You will be able to configure the waveform (waveform type, samples per cycle, and cycle per buffer) from the User Interface. The buffer size is determined by the parameter, "sampsPerChanToAcquire", in the DAQmxCfgSampClkTiming. You can find more information on this, and other DAQmx functions in the NI DAQmx C Reference Help:
(in Windows) Start >> All Programs >> National Instruments >> NI DAQ

You can create a second channel to output a different waveform and add it to the same task.

Some helpful sites:
Using NI-DAQmx in LabWindows/CVI

Learn 10 Functions in NI-DAQmx and Solve 80% of Data Acquisition Applications

I hope this helps.

Thanks,
Lesley Y.
0 Kudos
Message 2 of 13
(4,865 Views)
I try "ContGen-IntClk.prj" before asking, but obviously these example did't use FIFO.
Maximum frequence is 120kHz (even with 3 samples per periode).
Almost the same project in LabView work fine, I can generate 600 kHz, and that project explicite define FIFO, which I can't found in CVI.
0 Kudos
Message 3 of 13
(4,846 Views)
Hi Oldi,

There are two modes of FIFO generation: regeneration and non-regeneration. If you're performing buffered analog output, the data samples should be moved into the FIFO first.

From the M-Series Help:

Regeneration is the repetition of the data that is already in the buffer. Standard regeneration is when data from the PC buffer is continually downloaded to the FIFO to be written out. New data can be written to the PC buffer at any time without disrupting the output.
With FIFO regeneration, the entire buffer is downloaded to the FIFO and regenerated from there. Once the data is downloaded, new data cannot be written to the FIFO. To use FIFO regeneration, the entire buffer must fit within the FIFO size. The advantage of using FIFO regeneration is that it does not require communication with the main host memory once the operation is started, thereby preventing any problems that may occur due to excessive bus traffic.

With non-regeneration, old data will not be repeated. New data must be continually written to the buffer. If the program does not write new data to the buffer at a fast enough rate to keep up with the generation, the buffer will underflow and cause an error.

I hope the above information helps. If not, please indicate which LabVIEW example you are using and we can continue from there.

Thanks,
Lesley Y.
0 Kudos
Message 4 of 13
(4,844 Views)
Of course we need regeneration.
In "AO FIFO Regen.vi" (these new .vi we get from your demonstrator 1 week ago and I'm not sure if name is OK), everything works just like we want.
So the problem is that I can’t find any useful information how to (in CVI) work with FIFO and how to turn on regeneration.
PS: Theory of FIFO regeneration is simple for me, because I’m electronic engineer with many years of experience on that field.
0 Kudos
Message 5 of 13
(4,837 Views)
Hi Oldi,

You can set to the FIFO regeneration mode using the following function:

DAQmxSetWriteAttribute (" ", DAQmx_Write_RegenMode, DAQmx_Val_AllowRegen);

This will allow DAQmx to regenerate samples that the device previously generated. The write marker returns to the beginning of the buffer after the device generates all samples currently in the buffer.

Thanks,
Lesley
Message 6 of 13
(4,832 Views)
Putting DAQmxSetWriteAttribute in almost every second line in ContGen-IntClk.prj, but it’s still the same. When I'm starting some hi frequency (100kHz), computer almost freeze, so it must still running without regeneration. Over 100kHz same error report, that there was no data to convert to analog signal.

It's really so hard to do these so simple thing, Put data in FIFO, set DA timing and start in regenerate mode.
I try everything, but nothing. It's also nothing in Help, only boring information, which I know for 20 years.
0 Kudos
Message 7 of 13
(4,811 Views)
Hi Oldi,

Please try the sample program attached.

Thanks,
Lesley
Message 8 of 13
(4,788 Views)
Thank you very much; it works, but obviously from PC memory with DMA. These may be a problem during reading AD with 1.25MS/s.
Is there any simple change to work in on board FIFO mode?
0 Kudos
Message 9 of 13
(4,757 Views)
Oldi,

Both the example attached and the Cont Gen-Int Clk example regenerate from the buffer. After the task is started, it is inside a while loop with no new data written to it and hence must loop through the buffer to regenerate. I have also tested this by monitoring the output, and verifying that the data does not change even when I change my waveform specifications on the user interface after the generation has started.

My understanding is that you're trying to load waveform data onto the onboard FIFO when you start the program, and loop through this data on the FIFO. Please let me know if this is correct. What is the specific LabVIEW exmaple you're using? Is it possible that the data you're trying to write to the FIFO is greater than the 8191 samples (size of onboard AO FIFO)?

Lesley
0 Kudos
Message 10 of 13
(4,749 Views)