07-04-2013 10:42 AM
Hi there,
I'm relatively new to Labview, so sorry about the code in advance. I'm trying to make a simple function generator, and so I'm using this while loop, and it's supposed to run for 1000ms (the length of the buffer with it's sample rate and number of samples), but I'm getting a delay of anywhere between 25 - 30 ms.
Any ideas in how to fix this, or where it's coming from?
Thank you kindly in advance.
Solved! Go to Solution.
07-04-2013 10:44 AM
could you post it in a earlier version please
Thanks
07-04-2013 10:58 AM
Why are you setting up and clearing the task inside of the while loop? You should only setup once before the loop and stop/clear it after the loop. All you should have inside of your while loop is the DAQmx Write.
07-04-2013 11:31 AM
I don't quite understand what you mean, sorry. If I have just the DAQmx write in my loop, the data only ouputs once. What I need to do is have a constant output of this waveform, without the delay between cycles
07-05-2013 08:05 AM
After thinking about this some more, I think what you really need is the Regeneration Mode. Put down a DAQmx Write property node and choose the RegenMode. Set it to allow. What this will do is cause the task to repeat automatically. All you'll have to do is set that property, perform the DAQmx Write with the Auto Start set to FALSE, use the DAQmx Start Task when you want the waveform to start, and DAQmx Stop Task when you want it all to end. You will probably need to write a 0 to the task when you are all done to reset those channels.
07-05-2013 08:57 AM
Almost there! Now the delay is ~16ms, instead of 25ms. I added the DAQmx Clear Task to append that zero as you said to, but I'm guessing that the rest of the delay is due to the actual code running/outputting?
07-05-2013 09:08 AM
Also, here's what the file looks like now:
07-05-2013 10:08 AM
You don't need the while loop at all. Put in an event structure or something of the like to pause you program until you want to stop. The hardware will take care of it all for you.
07-05-2013 11:58 AM
@crossrulz wrote:
You don't need the while loop at all. Put in an event structure or something of the like to pause you program until you want to stop. The hardware will take care of it all for you.
Hi,
When I tried open the attached VI, it was looking for a polymorphic VI (with a specific instance of "Multi Channel Wfm w/Attributes - DBL")...
Any idea, where to download this from?
07-05-2013 12:05 PM
For some reason, this only runs the signal once, then outputs a negative DC offset.
Any idea why?