LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

loop taking longer time at each iteration


@rolfk wrote:
It is however a but-ugly solution for something that is done 10 times exactly the same! .

More specifically, requiring these clusters at the end still forces us to change the cluster size of array to cluster as well as editing the controls/indicators. I would recommend to keep the outputs as arrays. A cluster with all identical scalar element types is not very scalable and should not be needed.

0 Kudos
Message 11 of 18
(416 Views)

Hello,

 

After many tests, I found that the part of that VI taking longer is the "DAQmx Read.vi"

Do you know why so ?

Also, the property node doesn't take a single second to get done.

FNIORT_0-1750249196598.png

The cleanup also take longer, but only about 50ms more than the first iterations, so that's no big deal.

 

FNIORT_1-1750249236420.png

 

Here is how I measure time for each step.

 

If anyone has any idea, I'd love to hear about it

0 Kudos
Message 12 of 18
(384 Views)

DAQmx Read returns after:

 

- an error occured in the driver

- the specified timeout occured (with according timeout error)

- the required amount of samples have been read

 

Your 2298 ms for DAQmx Read come from the case 3 above. You have a sampling rate and some number of samples to acquire. The samples don't just appear instantously, you did specify a sampling rate after all that your DAQ card tries to faithfully oblige to.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 13 of 18
(376 Views)

@rolfk wrote:

 

Your 2298 ms for DAQmx Read come from the case 3 above. You have a sampling rate and some number of samples to acquire. The samples don't just appear instantously, you did specify a sampling rate after all that your DAQ card tries to faithfully oblige to.


But in that case the time should not get "longer" as the program runs, but be always slow. I guess I misunderstood the original question. 😄

0 Kudos
Message 14 of 18
(360 Views)

It seems you Create and Destroy the DAQ tasks each iterations, just like with the result file you should create them once outside the loop and reuse them throughout.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 18
(355 Views)

I'm acquiring data of differnt modules (thermocouples, current, voltage, and digital I/O), do you think I can keep my tasks open and keep acquiring all of them ?

0 Kudos
Message 16 of 18
(337 Views)

Hi F.,

 


@F.NIORT wrote:

do you think I can keep my tasks open and keep acquiring all of them ?


YES!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 17 of 18
(327 Views)

@altenbach wrote:

@rolfk wrote:

 

Your 2298 ms for DAQmx Read come from the case 3 above. You have a sampling rate and some number of samples to acquire. The samples don't just appear instantously, you did specify a sampling rate after all that your DAQ card tries to faithfully oblige to.


But in that case the time should not get "longer" as the program runs, but be always slow. I guess I misunderstood the original question. 😄


I, possibly wrongly, assumed this was a different/new problem that had nothing to do with the original problem that was caused by other things than this DAQ Read.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 18 of 18
(311 Views)