From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Dynamically Call Multiple SubVIs From a Queue

Code and Documents


This example shows how to use a producer\consumer design pattern with a queue to dynamically call multiple subVIs. The subVIs are called and then run independently of This means that they are running but does not wait for them to finish executing before continuing (they are non-modal).  This is useful if you want to create a scalable solution for having multiple popup windows while still allowing the main part of the program to run.

The Main VI has two buttons that will call two separate subVIs.  The first subVI shows the amount of time that has elapsed since it was called.  The second subVI generates and displays a random number.

In this example, user events add subvis to a queue that will be called in the consumer loop.  In other applications, any type of event (i.e. programatic event) can add a subVI to the queue.

Main VI:




Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.


hey can u share the procedure please how to do the above task?