LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What determines Finished Late? flag in timed loop?

I've monitored the Global Start Time (and Iteration Start) from iteration to iteration in a real-time loop.  These delta time between iteration starts varies beyond my loop rate (e.g. 1680 usec between iteration starts with a 1666 usec period), yet the Finished Late? flag does not indicate true.  Maintain Phase is TRUE, Discard Missed Periods is FALSE, Deadline and Timeout are default (-1).  So why does Finished Late? not fire when all clocks tell me the loop was late?

0 Kudos
Message 1 of 4
(2,804 Views)

It would be helpful if you could post a snippet of your code.

 

I assume that you're running this on an RT controller?

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 4
(2,772 Views)

 

A (very) rough example is below and some results (run on an RT controller).  I guess the loop didn't "finish late" but it appears that they can (and usually do) start (significantly) late or early so am I missing something?  This jitter is there even when the Chart and Stop button are removed from the timed loop (e.g. using RT FIFOs to send the data to a chart loop).  To some extent I answered my own question - my loops are not "finishing late" so the flag isn't set, but apparently the jitter here is significant.  In this simplistic example, I saw jitter of +/- 4 ticks (usec) when the CPU usage is at barely 1% per core (dual core) - so is the RT jitter just bad in general or is it the 1Mhz clock or ???

 

 

 

 

Download All
0 Kudos
Message 3 of 4
(2,745 Views)

The "Finished Late?" flag indicates if the previous iteration of the while loop toke longer time to complete, than the period of the while loop. 

In you case, the code in the while loop has to take longer than 1666 µs to complete for this flag to be set.

I don't think your simple code will ever do that.

 

Regarding the jitter, you a seening a jitter of +/-2, not +/-4.

If that is much, I don't know, maybe some else can answer that.

 

0 Kudos
Message 4 of 4
(2,694 Views)