Developing the Top-Level VI in Application Software

NI InsightCM™ SDK 3.3 Help

Edition Date: December 2018

Part Number: 375191F-01

»View Product Info
Download Help (Windows Only)

The software that runs on RT targets consists of a top-level VI that initializes the application, executes several processes in parallel, and handles closing the software and rebooting the target. When you extend the software, your unique programming goals might require you to modify the top-level VI in the SDK device reference code.

What to Use

  • Main VI from the SDK reference node
  • Create Listener VIs from project libraries
  • Dataflow VIs
  • User-developed process VIs

What to Do

Create the following block diagram within the Main VI to initialize and run NI-developed and user-developed processes. SubVIs with blue banners are NI-developed, whereas subVIs with red banners represent code you might develop.

Customize the gray sections for your unique programming goals.

Prepare Qbus to handle messages for each process that runs in the top-level VI. This subVI sets up the Qbus message bus that implements communication between processes, sets the NI-developed processes in the Dataflow Script, and sets other global data structures that processes read and write operations.
Note  To avoid conflicts when migrating code to future versions of the SDK, NI recommends you do not edit the Initialize VI.
To perform any of the following tasks, insert your custom code here:
  • Initialize a custom process with Qbus. For example, you can initialize a custom process with Qbus by placing the Create Listener VI for that process in the Initialize Customer Process VI.
  • Add, remove, or change the order of processes in the Dataflow Script from the default configuration that the Initialize VI sets.
  • Set any global properties, such as directory paths, and set storage containers, such as point value maps, on which other processes depend.
Call custom process VIs as subVIs that run in parallel with the NI-developed processes. Each process must receive a reference to Qbus. To remove a process, delete it from this Case structure and delete its Create Listener VI within the Initialize VI.
To perform any clean-up or other shutdown-related tasks that you cannot perform within a process, add your custom code before the NI-developed Shutdown VI.
Use the Shutdown VI to handle manual and programmatic requests to shut down the controller. This code destroys the Qbus instance and, optionally, restarts the controller.
Note  To avoid conflicts when migrating code to future versions of the SDK, NI recommends you do not edit the Shutdown VI.


  • Convert your custom initialization and shutdown code to subVIs to save space and simplify future updates to this code.
  • Examine the Initialize VI and the Shutdown VI to learn about the tasks the NI-developed subVIs perform.

Related Information

Initializing the Application Software

Setting the Processes in the Dataflow Script

Creating a New Process

Components of a Project Library


Not Helpful