LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running myDAQ Operations Fast

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(3,198 Views)
Solution
Accepted by T.Rock

Create the task outside the loop or only on the first loop iteration, and on later iterations just write to the task.

Message 2 of 8
(3,194 Views)

Thanks! That significantly sped up the iterations.

T.Rock

0 Kudos
Message 3 of 8
(3,185 Views)

NP - make sure you are closing the task when you are done with it as well.

Message 4 of 8
(3,182 Views)

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 

Download All
0 Kudos
Message 5 of 8
(3,174 Views)

What are you trying to do? What is the source of the data you are writing to the output?

0 Kudos
Message 6 of 8
(3,164 Views)

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

 

Download All
0 Kudos
Message 7 of 8
(3,149 Views)

 You could build up the entire array/waveform and write it to the card all at once versus writing it sample by sample. 

0 Kudos
Message 8 of 8
(3,114 Views)