12-17-2018 02:33 PM
Hello all,
I would like to write a program that frequently changes the voltage outputted by my myDAQ. I currently am using this piece of code (image). Even when in a for loop with no delay there is a delay of around 20ms. Is there anyway I can reduce this?
The delay is definitely in this section of code and not somewhere else in the loop. I know this as if I delete this section, the loop runs through all iterations (almost) immediately.
I am new to LabView and the myDAQ so please bear with me!
Many thanks in advance,
T.Rock
Solved! Go to Solution.
12-17-2018 02:43 PM
Create the task outside the loop or only on the first loop iteration, and on later iterations just write to the task.
12-17-2018 02:55 PM
Thanks! That significantly sped up the iterations.
T.Rock
12-17-2018 03:00 PM
NP - make sure you are closing the task when you are done with it as well.
12-17-2018 03:17 PM
Thank you for the advice, I have now added a clear task VI. Although moving the setup outside the loop greatly improved speed, ideally for my application I would like the loop to be able to run even faster. Is there any possible way to do so? I have attached an image of the relevant code below.
T.Rock
12-17-2018 03:32 PM
What are you trying to do? What is the source of the data you are writing to the output?
12-17-2018 03:57 PM
The data source is Cartesian coordinates converted from a polar function whose theta value increases with each loop iteration.
My goal is to input these voltage values into a dual channel CRT vector scope fast enough so that I can effectively draw polar equations.
I have attached a screen clip of the program and also the zipped project file if you would like to take a look.
Thanks again for the help!
T.Rock
12-18-2018 08:12 AM
You could build up the entire array/waveform and write it to the card all at once versus writing it sample by sample.