Changing the Order in Which Pre-build VI Receives Top-Level Vis During LabVIEW Application Build

Updated Jul 18, 2025

Reported In

Software

  • LabVIEW

Issue Details

When building a LabVIEW application, I check the Pre-Build actions checkbox in the Build Specifications. I expect the Pre-Build VI to get the Top-Level (or Always Included) VIs in the same order they are added to the Source Files. These Top-Level VIs come as an array in the Pre-Build VI. However, I noticed that the Pre-Build VI gets these Top-Level VIs in a random order. How can I change this order so that I always know what index each VI path will have in the Top-Level/Always Included VIs array?

Solution

The order is based on the VI indexes in the project file (XML format).
 
image.png

However, in the build specification, they are displayed in alphabetical order.
  • Add Vis in some random order
image_11
  • Press OK to save the build specification
  • Open the build specification properties
image_12

If you need them to have some custom order, you can manipulate VI indexes in the lvproj file.

As the source indexes are never changed after being created for a specific VI, you can remove the source items corresponding to their VIs and add them in your desired order in the build specification or lvproj file (pay attention to the properties and be extremely careful here).

You should remember that, in that case, the order displayed in the Build Specification won't correspond to the order of VIs indexed in the lvproj file.

image.png

Additional Information

The order in which the Startup and Always Included VIs are passed to the Pre-Build VI depends on the order in which the VIs were created in the project.

image.png

The VIs were created/added in the project in the following order: B1, D2, A3, C4, E5, Startup. That's why the input array receiving these VIs might have different indexes depending on when you created each VI.
​​​