Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAC gets into bad state

The attached CVI program works correctly for a few seconds, and then, after a random interval, puts the DAC of my 4461 into a bad state, outputting full-scale noise rather than the correct signal.  Then the DAC fixes itself again after another random, few second interval, and repeats.  Could someone please check this out and explain?  Connect DAC0 to a scope to observe the problem.  It's only a few lines, representing a serious problem in my application.
 
 
0 Kudos
Message 1 of 7
(3,605 Views)

Hi Skim2,

It looks like you're trying to do variable rates on your generation by resetting the sample clock rate within a loop. There are a couple things that might be causing the behavior you are seeing. The most likely is that you are starting and stopping your task within the loop. I think you're probably doing that because you think its necessary for resetting the timing, but thats not the case and is generally not very effective. Starting and stopping a task generally causes delays in generation (and acquisition) so that could be part of what you're seeing. You can reset the sample rate within a loop using DAQmxSetSampClkRate().  You'll want to place starting and stopping as well as configuring and writing outside of the loop.

Hope this helps,

Andrew S.

National Instruments

0 Kudos
Message 2 of 7
(3,583 Views)

Dear Andrew,

Thanks but, DAQmxSetSampClkRate doesn't seem to be in my library.  Any idea why?  Also, I don't think the 4461 can switch to a new sample rate while the DAC task is running.  Unfortunately, it's a fundamental limitation of the Delta-Sigma converter.  Did I post to the wrong forum?  Are the DSA cards included under Multifunction DAQ?

Issue still unresolved,

Josh (sorry, I switched usernames on you.  I am AKA skim2.)

 

0 Kudos
Message 3 of 7
(3,573 Views)
Hi Josh,
 
Sorry, I looked right over the 4461 when I was looking at your code. You're right, you can't change sample rates with DSA. DAQmxSetSampClkRate doesn't have a fp for CVI, but it is included in the DAQmx API if you need to use it with oter cards in the future.
 
What are you trying to do with this code? It looks like you are trying to adjust the frequency of the sine wave by changing the sample rate. Is this correct? How are you going to be using this? Is there a reason why building an array with two frequencies wouldn't work?
 
Any time you start and stop a task there are going to be some floating values between generations. I have been able to repeat the behavior you are seeing, but only when I close and open CVI and run your code the first time. I generally only get this noise once. How often and in what situations do you see this noise? Here is a screen shot of what I caught -
 
 
Is this similar to what you are seeing? I'm looking into what is causing this.
 
Hope this helps, let me know what you find out.
 
Andrew S.

Message Edited by stilly32 on 10-05-2006 04:19 PM

Message Edited by stilly32 on 10-05-2006 04:20 PM

0 Kudos
Message 4 of 7
(3,543 Views)

Dear Andrew,

Floating while the task is stopped is not the problem, and your plot does not show the problem.  Your plot shows what I expect to see, and what I do see, but only for a few seconds.  After a few seconds, my output changes to high frequency noise with an amplitude of 10 Volts, while the AO task is running.  Even if I set my output signal amplitude to be 1 Volt, or 0.1 Volts, it still switches to 10 Volt noise after a few seconds.  I am surprised that you are not seeing this.

I need two different sample rates because I need a constant number of waveform cycles in a constant blocksize, with different signal frequencies.

Josh

 

0 Kudos
Message 5 of 7
(3,532 Views)

Andrew,

I'm trying to figure out how to show you what I'm seeing on my o'scope.  What did you use to make that plot?  The same DSA card that generated the signal, or a different one?  It would have to be a different card, because the ADC rate always has to be an even multiple of the DAC rate, and your plot doesn't show that the ADC stopped and restarted when the DAC stopped and restarted, right?  I don't think I have another NI card to use for an o'scope.  Hmm.

Josh

 

0 Kudos
Message 6 of 7
(3,528 Views)

Andrew,

I do have another 4461.  Were you using another 4461 for your o'scope channel?  Because if so, you could send me your program, so I could use it to help demonstrate the problem.

Josh

 

0 Kudos
Message 7 of 7
(3,525 Views)