LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop finished late [i-1]

I am using timed loop in my labVIEW project.

There are scheduler inside timed loop.

We have simulated 15 nodes, That transmits message at rate of 40 ms.

When I run the code on my development machine then it working fine till all iterations.

But when I run it on other machine it iterates once and stops.

 

When I debug I found that finished late Boolean [i-1] becomes true after first iteration and loop stops.

 

why this so?

 

Is this related to operating system ?

 

When I read LaBVIEW help about this -

 

Finished Late? [i-1] (First frame only) Returns TRUE if the Timed Loop does not complete the previous iteration before the specified deadline.
0 Kudos
Message 1 of 5
(3,451 Views)

You run the loop at 1 kHz. Probably you are using Windows? This is not a deterministic operating system. This means that other processes, for instance your virus scanner, can start running and delaying the Labview process. 1 kHz loop rate is something you would do on a FPGA, it is way too fast for Windows. Try it at 10 Hz and see if it works then.

0 Kudos
Message 2 of 5
(3,447 Views)

HI LennartM thank you for your feedback.

I am using windows 7 on both machine , on one machine it is working fine.

What could be the reason that same code is not working on another machine


@LennartM

 

0 Kudos
Message 3 of 5
(3,419 Views)

Hi,

It looks like the period of your loop is 20ms, so the frequency is 50Hz.

 

As LennartM said to you, it depends not only on the windows 7 but also the programs you installed on your machine, the number of processor, etc... There could be many reasons why programs don't execute exactly the same way on both machines.

What you can do is to benchmark your code to measure the time execution and then improve your code or adjust the period.

 

Regards,

0 Kudos
Message 4 of 5
(3,413 Views)

Hi Yeshwant,

 

What could be the reason that same code is not working on another machine

Maybe a completely different environment on that "other machine"? Other software running in the background, other virus scanner, other network connection quality, …

 

On your code image:

- Why do you use a TWL at all on a default Windows OS? Why not use a simple While loop with a plain wait function inside?

- Why do you stop the TWL on "finished late"? Why not let it run and try to catch up?

- What's inside those other sequence frames? What's inside all those subVIs? Any code able to run longer than expected?

- Why do you set the TWL to loop at 20ms when you write your transmission needs 40ms?

- Why don't you use autoindexing in the inner FOR loop?

 

Next time please attach real VIs instead of just showing an image with a small part of the code!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(3,411 Views)