LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Period (dt) right data node for Timed Loops

I'm struggling to understand how the Period right data node functions. The help indicates that it should set the period for the next iteration of the timed loop, but I'm finding that it seems to set the period for the current iteration of the timed loop. Perhaps I'm not timing things appropriately. Hopefully someone can set me straight here.

 

I've attached a .vi that should demonstrate the issue. TIA for education/assistance.

Download All
0 Kudos
Message 1 of 4
(3,519 Views)

Hello !

 

The period is the length of time between iterations of a Timed Loop specified in absolute units of the structure timing source.

 

The subdiagram of a Timed Loop must completes execution before the period specified for each iteration. If the subdiagram of the Timed Loop  completes execution before the period of the loop, the Timed Loop sleeps and allows other code or structures to execute on the block diagram. A time-critical loop, which does not have any sleep time, will completely monopolize the embedded CPU resources, this is know as starve the system of CPU.

 

In the attachment, the Timed Loops use the default 1 kHz timing source. The period (dt) for Loop A is 1000 ms and the period for Loop B is 2000 ms, which means Loop A executes every second and Loop B executes every two seconds. Both Timed Loops stop executing after six iterations. Loop A stops executing after six seconds, and Loop B stops executing after 12 seconds.

 

I hope this information is useful.

 

Pablo

 

0 Kudos
Message 2 of 4
(3,471 Views)

That information is useful as a basic tutorial on how timed loops work in general

 

But reading it, I don't see how it answers the questions the original poster had asked and his observations on how his VI is actually functioning, particulary on the use of the right hand side dT node.

0 Kudos
Message 3 of 4
(3,454 Views)

Thanks for the explanation of how a timed loop works. It confirms that I understand the function of the timed loop overall. What I don't understand is why the Period right data node seems to act on the current iteration of the timed loop rather than on the next iteration as described in the help. Any illumination there?

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