Home > Support > NI Product Manuals > LabVIEW Communications System Design Suite 1.0 Manual

Synchronizing the Execution of Multiple Loops

By default, LabVIEW executes each loop iteration as quickly as possible based on the code inside the loop. However, consider a program that includes multiple loops that contain code requiring different amounts of time to execute. You might want to control the rate at which those loops execute in order to synchronize their execution and ensure that the loops begin each iteration at the same time. Use Wait Until Next ms Multiple to do this.

What to Use

What to Do

Create the following diagram to synchronize the execution of multiple loops.

Customize the gray sections for your unique programming goals.

Wire the same value to the millisecond multiple input of the Wait Until Next ms Multiple nodes placed on the subdiagram of each loop. The loops wait until the value of the system millisecond clock becomes a multiple of the specified millisecond multiple before beginning each iteration. Therefore, the loops begin each iteration at exactly the same time.

When specifying a value for the millisecond multiple input of Wait Until Next ms Multiple, ensure that the value is greater than the time required to execute the code inside the loop. If a loop contains code that takes longer to execute than the time specified for millisecond multiple, Wait Until Next ms Multiple has no effect on the execution speed of the loop.

Related Topics