Adds a new project item of the specified type to the LabVIEW project with the referenced item as the parent. You also can use the Project Explorer window to add an item to a project.

This method returns an error if the specified type cannot be created under the current item. The method also returns an error when you try to add a shared variable to a library that is not opened in a project.

Note The LabVIEW Datalogging and Supervisory Control Module supports this method in the Run-Time Engine.

Parameters

Name Data type Required Description
Name cstr.png Yes

Name of the project item you want to add.

Path cpath.png Yes

Path to the project item you want to add.

Type cstr.png Yes
Specifies the project item type. The following values are the most common Type values:
  • VI
  • Folder
  • Library
  • XControl
  • EXE
  • DLL
  • Source Distribution
  • Installer
  • Zip File
  • Hyperlink
Some of the values listed above are supported only on certain LabVIEW Development Systems. Refer to ni.com/labview for more information about LabVIEW Development Systems.

To determine the value of Type for a project item that is not listed above, use the Type String property to programmatically return the type of the item.

Remarks

The following table lists the characteristics of this method.

Short Name AddItem
Data type cprjitrn.png
Available in Run-Time Engine No
Available in Real-Time Operating System No
Settable when the VI is running No
Loads the front panel into memory No
Need to authenticate before use No
Loads the block diagram into memory No
Remote access allowed Yes

Examples

Refer to the following example files included with LabVIEW.

  • labview\examples\Application Control\VI Server\Manipulating Projects\Add Files to Project.vi