LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

On timed loops

So i've done a bit of reading on timed loops. This thread suggests the maximum limit is 128, any more and labview crashes.

 

I have a VI that currently uses 12 of them at the same time. One is a state machine that actually calculates stuff, the 11 others are mostly data updates for various modules (most are set to update every 1000ms).

I've been wondering, is it better resource wise to have them like this, separated, or to use one single timed loop for all data updates? I imagine using only one timed loop would cause "spikes" in resource use, while several would be more "smooth".

Would it perhaps be best to use one single timed loop, but use frames to separate the module reading?

0 Kudos
Message 1 of 4
(820 Views)

Hi Soul,

 


@AeroSoul wrote:

I've been wondering, is it better resource wise to have them like this, separated, or to use one single timed loop for all data updates? I imagine using only one timed loop would cause "spikes" in resource use, while several would be more "smooth".

Would it perhaps be best to use one single timed loop, but use frames to separate the module reading?


A "frame" aka sequence structure almost never is the solution to a programming problem…

 

Where do you run your VI(s)? Anything else than a RT system will not benefit from using TimedLoops…

Why do you need one VI with 12 timed loops inside? (This questions splits into two parts: "why don't you seperate your 12 loops into 12 VIs?" and "why do you need so many timed loops at all?")

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(794 Views)

@GerdW wrote:

Hi Soul,

 


@AeroSoul wrote:

I've been wondering, is it better resource wise to have them like this, separated, or to use one single timed loop for all data updates? I imagine using only one timed loop would cause "spikes" in resource use, while several would be more "smooth".

Would it perhaps be best to use one single timed loop, but use frames to separate the module reading?


A "frame" aka sequence structure almost never is the solution to a programming problem…

 

Where do you run your VI(s)? Anything else than a RT system will not benefit from using TimedLoops…

Why do you need one VI with 12 timed loops inside? (This questions splits into two parts: "why don't you seperate your 12 loops into 12 VIs?" and "why do you need so many timed loops at all?")


The application is ran on a Windows 10/11 computer.

As with most of my questions, the answer is legacy code... The OG programmer made pretty much all "interactable" VIs so that he has a main timed loop and then about a dozen other timed loops to pull data from action engines (one timed loop per AE usually). There's usually also an event loop to handle any events.

Why timed loops? I'm guessing because he needed things to happen exactly on the second and didn't trust other timing methods?

0 Kudos
Message 3 of 4
(688 Views)

Hi Soul,

 


@AeroSoul wrote:

Why timed loops? I'm guessing because he needed things to happen exactly on the second and didn't trust other timing methods?

On Windows you cannot trust timed loops, especially not "happen exactly on the second" for parallel loops.

So why don't you replace them by ordinary while loops with a wait inside?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(674 Views)