Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating Deterministic Applications Using the Timed Loop (RT Module)

LabVIEW 8.5 Real-Time Module Help
August 2007

NI Part Number:
370622E-01

»View Product Info

Separate deterministic tasks from non-deterministic tasks and place them in a different Timed Loop in an RT target VI to ensure the deterministic tasks receive enough processor resources. A Timed Loop executes a subdiagram each iteration of the loop at the period and priority you specify. The higher the priority of a Timed Loop, the greater priority the structure has relative to other timed structures on the block diagram. Use deterministic communication methods to share data locally from the deterministic Timed Loop or to share data remotely across a network.

The following figure shows the block diagram of an RT target VI that contains two Timed Loops to control a data acquisition and logging application.

The deterministic loop set to the higher priority of 100 contains a subVI that performs a data acquisition task every iteration of the loop. The deterministic loop shares the acquired data with the non-deterministic loop using a shared variable, data. Shared variables with the real-time FIFO enabled can share data deterministically from a VI running on an RT target without affecting the determinism of the VI. The non-deterministic loop with a priority of 50 logs the acquired data that it reads from the shared variable data to disk on the RT target.

Cooperatively Yielding Timed Loop Execution

Because of the preemptive nature of Timed Loops, they can monopolize processor resources. A Timed Loop might use all of the processor resources, not allowing lower priority tasks on the block diagram to execute.

You must configure a deterministic Timed Loop with a period large enough to perform the deterministic task and still have idle time during the iteration to allow lower priority tasks to execute. By timing Timed Loops, you can yield the execution of deterministic tasks and cooperatively relinquish processor resources to lower priority tasks on the block diagram.

Note  If you want to run an RT application on a system with multiple CPUs, consider targeting the time-critical Timed Loop to a dedicated CPU.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit