Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create glitch-free continuously changing buffered outputs waveforms?

Solved!
Go to solution

Hi, could you point me to the most appropriate example for the following case:

 

I am reading and writing analog and digital data at a rate of about 5kHz.  At this rate I need to read and write N samples at a time and cannot do single point reads and writes. I would like to ensure that my output waveform is glitchfree, so how do I push the next N samples to the DAQ card (PCI-6221) before it has finished writing the previous N samples?  This would ensure that by the time it has finished with the previous buffer, it will continue with the next buffer without missing a clock.

 

I cannot use a blocking write or poll the task for when it is done as by the time I manage to write the next N samples a clock or two would have passed. 

 

Any ideas? 

0 Kudos
Message 1 of 3
(3,308 Views)
Solution
Accepted by topic author AnthonV

Hi AnthonV,

 

From what you've described so far, I think the following shipping example would be a good place to start:

Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Voltage >>

Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi

The main idea is to set the task to Continuous (but not allow regeneration from the buffer).  Data is written continuously in the while loop while the task is still running, so as long as your loop rate can keep up with the generation this should accomplish what you need.

 

If you have any questions about the example don't hesitate to ask.  Thanks for posting and have a great day!

 

-John

John Passiak
0 Kudos
Message 2 of 3
(3,286 Views)

Thanks yes this worked - Initially when I tried it I made the mistake of wiring a non-zero value to the 'timeout' terminal on the write vi in a while loop.  When the FIFO filled up, the write call blocked until space became available.  Wiring a zero to the timeout and handling a buffer full error has done the trick for me.

 

 

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