Yes, it is possible to programmatically look at all builds present within a project. As shown in the figure below, you would use a set of invoke and property nodes to open the project, get all the descendents of type "EXE" (application builds), and create an array of with their names.
To recreate this VI, follow the steps listed below:
- Place an invoke node on the block diagram. This invoke node is found in the functions palette by going to Programming»Application Control»Invoke Node. Right-click the invoke node and select Methods»Project»Open. This will load the LabVIEW project.
- Right-click the path input and Create»Control. Place a second invoke node on the blockdiagram and connect the Project Open output to the reference input of this second invoke node. Right-click the invoke node and select Method»Open Window. This will display the Project Explorer Window. You can then select the appropriate path to the project.
- Place a property node on the block diagram, which is found by going to Programming»Application Control»Property Node in the functions palette. Connect the reference and error outputs of the second invoke node to the reference and error inputs of the property node.
- Right-click the property node and select Properties»Root. This returns a reference to the project root in the Project Explorer Window.
- Place a third invoke node on the block diagram. Connect the Root output of the property node to the reference input of the third invoke node. Right-click the invoke node and selectMethods»Get All Descendents. This returns project items that are descendants of the referenced item.
- Right-click the Type input terminal and select Create»constant. Type EXE as the string constant. Place a For Loop after the third invoke node and add a second property node inside the loop. Connect the output of Get All Descendents to the reference input of the second property node. Right-click the property node and select Properties»Children which returns an array of references to all children of the referenced project item.
- Expand the property node to allow for a second property. Right-click this property and select Properties»Name. This gets the name of the references project item.
- With autoindexing enabled, wire the output of the Name property to an indicator that is outside of the For Loop. This indicator will show the Build Names within the specified project.
- Connect the error wires as shown in the following block diagram
If you do not specify EXE, LabVIEW returns all project descendents (builds, VIs, libraries, etc...). The help for the Get All Descendents method lists other possible types that you can specify besides EXE that might be useful, such as VI, DLL, source distribution, and installer.Note:
After you find the names of builds present in a project, you might want to build those build specifications. To do this in LabVIEW 2011 or later, use the Build VI. In LabVIEW 2010 or earlier (refer to build VI
in LabVIEW help), use the BuildTargetBuildSpecification VI located in the labview\vi.lib\AppBuilder directory.