LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

missed generations (resetting task)

Hi All,

 

I am writing some LabVIEW code to be used with a cDAQ-9172.

I want to repeatedly output an analog waveform after receiving digital trigger.  I understand there are a couple ways to do this, but the most promising for our purpose uses "DAQmx wait until done", stopping the task, and restarting it.  Attached is a simplified version of what I am doing.

 

It works great, except that at certain frequencies with certain time-outs generations are missed, or even worse in our application, cut short (leaving a voltage offset until the next generation).  For example, if the timeout is 0.03 s, and I have a digital trigger at a frequency of 13.3 Hz, the analog output is often missed or cut short.  Frequencies above and below this are no problem, though.  Does anyone know what is going on and ways to minimize this issue (especially the unintended offset)?

 

Also, what is the allowed range of the timeout input in "DAQmx wait until done"?  I could not find it in the documentation and I assume it is not the full range of a double.

 

Thanks in advance

0 Kudos
Message 1 of 7
(3,472 Views)

I'm assuming your using a 9265 for your AO, but can you identify your DIO? As for the range for the DAQmx Wait Until Done, the two extremes are If you set timeout (sec) to -1, the VI waits indefinitely. If you set timeout (sec) to 0, the VI checks once and returns an error if the measurement or generation is not done.

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 2 of 7
(3,442 Views)

Thanks for the response.

For AO we use a NI 9263 and DIO a NI 9401.

 

What's the granularity of the timeout forDAQmx Wait Until Done?  i.e. How accurate is it and to what precision?  Is it accurate up to milliseconds, microseconds, etc?

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

Using Wait Until DoneAs documented, "...the Wait Until Done function/VI is used to ensure that the specified operation is complete before you stop the task." With that in mind the timeout's input as documented is set as seconds, so I don't believe it reaches millisecond measurement with  the two exteremes I mentioned above (wait indefintely or check once).

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 4 of 7
(3,402 Views)

In the documentation I see it only says "timeout (sec)."  I assume that is simply specifying the units (as opposed to ms).  It seems that if seconds were the least unit it could be adjusted by, then the parameter would be of type integer instead of double.  Do you have any reason to believe otherwise?  A quick empirical test shows that it does have accuracy down to at least 100 ms granularity.  Do you know anywhere I can confirm this and get a feel for finer adjustments?

 

The major issue, though, is why do waveforms sometimes get cut short and leave a voltage offset in my above program?

I would really appreciate help with that.

0 Kudos
Message 5 of 7
(3,394 Views)
Comparing your code to the "Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi", I noticed a couple of differences that could likely be the source of your cutoff waveform. If you open the example you'll notice the waveform and the DAQmx write is called for each iteration of the while loop and has the start task contained in a conditional statement that outputs the buffer when called for the first time, keeping phase continuity. Having the DAQmx Write vi outside the while loop I believe simulates regeneration since the same buffer is called for each start task, which explain why you don't get the entire signal at certain frequencies.   

Regards,
Glenn
0 Kudos
Message 6 of 7
(3,380 Views)
Regeneration.png

Regards,
Glenn
0 Kudos
Message 7 of 7
(3,378 Views)