10-10-2013 11:19 AM
Hi All,
I am using DAQ Assistant inside a loop to write a signal to an analong output module NI 9262 on a cDAQ-9174. I generate the signal either with the Simulate Signal express vi or with a simple loop using indexing. The problem is that when I change the frequency, using the same sample frequency, I have a different number of samples to write but the cDAQ doesn't seem to update the buffer size, so not all of my signal gets written out. The result is the first sine wave gets written nicely, but the ones after that get progressively cut off on the edges. I have plotted the imput signal that I generate, so I know it is being generated with the right size, and the starting frequency, what ever it is, always works, it's the ones following later in the loop that have the wrong buffer size aparently. I've tried resetting the cDAQ by adding another DAQ Assistant at the end of the outer loop with the stop bit set true, but that just gives me the error "resource unavailable".
Any ideas?
I'm using LabVIEW Base Developement System V12.0 32 bit.
Thanks,
Matt
Solved! Go to Solution.
10-10-2013 11:31 AM
Idea:
Get rid of the DAQ assistant and use the DAQmx API. The DAQ Assistant is there to support limited and basic funcionality to get a dirty experiment up and running quickly. The API vis offer more funcionallity and the DAQmx property nodes allow even greater flexability. DAQ Assistant is just too limited for your needs. (you can't paint a masterpiece with crayons)
10-11-2013 11:58 AM
Thanks Jeff,
that seemed to help, but now the wave form that I read back in is very spiky.
I plot the waveform before I send it to the cDAQ, so I know it's ok before writing. Here is the code for writing the wave form to the cDAQ:
I noticed that I input 3400 as the sample frequency, but the property node reads back out a SamplClk.Rate of 3400.06, so I wonder if that mismatch could be the reason for the spikiness.... By the way, I'm still reading the same waveform back in using a DAQ Assistant, but I doubt that is the problem. I later use a DAQmx Clear Task at the end, after reading in the measurements I want so it will be reset and I can write a new waveform of different size in the next loop iteration. Any advice?
Thanks again,
Matt
10-11-2013 12:42 PM
Strangly, I started writing out two waveforms and now the spikiness went away.