Project Template

From LabVIEW Wiki
Jump to: navigation, search
Create Project dialog

Standard templates

Some templates are installed with LabVIEW and addons.

LabVIEW

Name Description
Blank Project Creates a blank project.
Simple State Machine Facilitates defining the execution sequence for sections of code.
Queued Message Handler Facilitates multiple sections of code running in parallel and sending data between them.
Actor Framework Creates an application that consists of multiple, independent tasks that communicate with each other. This template makes extensive use of LabVIEW classes.
Finite Measurement Acquires a finite measurement and provides options for exporting the measurement to disk. This sample project is based on the Simple State Machine template.
Continuous Measurement and Logging Acquires measurements continuously and logs them to disk. This sample project is based on the Queued Message Handler template.
Feedback Evaporative Cooler Implements an evaporative cooler with hot-swappable hardware, controllers, and user interface. This sample project is based on the Actor Framework template.
Instrument Driver Project Creates an instrument driver.
Touch Panel Project Creates an application for touch panel running Windows Embedded Standard.

NI-DAQmx

Name Description
Continuous Measurement and Logging (NI-DAQmx) Implements a continuous data acquisition application using NI-DAQmx.
Finite Measurement (NI-DAQmx) Implements a finite data acquisition using NI-DAQmx.
LabVIEW Real-Time Control (NI-DAQmx) Implements deterministic, software-based control of a plant. This sample project uses NI-DAQmx.
LabVIEW Real-Time Waveform Acquisition and Logging (NI-DAQmx) Acquires continuous waveform data and logs it to disk. This sample project uses NI-DAQmx.

Project template locations

Project templates are loaded from two locations.

  • From the LabVIEW installation folder at <labview>\ProjectTemplates
  • From the LabVIEW Data directory at <LabVIEW Data>\ProjectTemplates. This folder does not exist by default and must be created manually.

Custom templates

LabVIEW supports custom project templates. These can be installed in either of the template folders. Inside ProjectTemplates are three subfolders.

  • CategoryOverrides - contains files that define how category filters are sorted in the Create Project dialog.
  • MetaData - contains files that define meta-data for each project template (name, category filters, etc.)
  • Source - contains the source files for the templates.

CategoryOverrides

Inside the CategoryOverrides directory can be zero or more XML files that define how category filters are sorted in the Create Project dialog. Each file must have a single root element <CategoryOverrides> with one or more <Category> elements. The following table lists child elements of <Category>.

Tag Description
<Name> Name of the category filter as it is used in the meta data XML file. This element can have an optional localize="yes" attribute.
<Priority> Priority of the category filter. Lower values have higher priority. A value less than 100 appears before default filters, such as "Templates" (100) and "Sample Projects" (200). Default filters, such as "Desktop", will always appear after custom filters.
<NonLocalizedName> Non-localized name of the category filter as it appears in the meta data XML file. Note: This element is undocumented.

Only one file exists under <labview>\ProjectTemplates\CategoryOverrides by default. NILV_Core_TemplateCategoryOverrides.xml defines category overrides for default filters ("Templates" and "Sample Projects").

<?xml version='1.0' encoding='windows-1252' standalone='yes'?>
<CategoryOverrides>

    <Category>
	<Name localize="yes">Templates</Name>
	<Priority>100</Priority>
	<NonLocalizedName>Templates</NonLocalizedName>
    </Category>

    <Category>
	<Name localize="yes">Sample Projects</Name>
	<Priority>200</Priority>
	<NonLocalizedName>Sample Projects</NonLocalizedName>
    </Category>

</CategoryOverrides>

MetaData

The MetaData directory contains XML files with meta data for each project template in the Source directory. Each file must have a single root element <MetaData> with one or more <ProjectTemplate> elements. The following table lists child tags for <ProjectTemplate>.

Required
Tag Description Example
<Title> Defines the title of the project template as it appears in the Create Project dialog. <Title>Blank Project</Title>
<Description> Defines the description of the project template as it appears in the Create Project dialog. <Description>Creates a blank project.</Description>
<Filters> Defines filters for the project template, which users can use to filter projects in the Create Project dialog. A colon (":") separates categories and a semi-colon (";") separates multiple filters. <Filters>Templates</Filters>
<LocationPath> Specifies a relative path to the source files of the project template. A forward slash ("/") must be used as the path separator. This path is relative to the ProjectTemplates\Source directory. <LocationPath>Core/Blank Project</LocationPath>
<ListboxImagePath> Specifies a relative path from <LocationPath> to an image file that is displayed besiede the project title in the Create Project dialog. The image dimensions should be 32x32 pixels. ListboxImagePath>images/blankproj.png</ListboxImagePath>
<ProjectPath> Specifies a relative path from <LocationPath> to the .lvproj file for the project template. This tag is optional if <CustomVIMode> is used. <ProjectPath></ProjectPath>
Optional
Tag Description Example
<Keywords> Defines keywords that users can use in the Additional Search box of the Create Project dialog. Multiple keywords are separated by semi-colon (";"). <Keywords>blank;project</Keywords>
<DocumentationPath> Specifies a relative path from <LocationPath> to an HTML file to provide help for the project. When used, a More Information link appears after the description, which links to the HTML document. <DocumentationPath></DocumentationPath>
<CustomVIMode> Determines if and when to run a custom VI during the project creation process. Supported values are:
  • None - No custom VI runs. This is the default value if this tag is omitted.
  • AfterPage1 - A custom VI runs right after the user selects a project.
  • AfterPage2NoUI - A custom VI runs after the second page of the Create Project dialog.
  • AfterPage2WithUI - A custom VI runs after the second page of the Create Project dialog. In this mode the custom VI is responsible for showing and hiding its panel.
<CustomVIMode>AfterPage1</CustomVIMode>
<CustomVIPath> Specifies a relative path from <LocationPath> to the custom VI to run duing the project creation process. This tag is ignored if CustomVIMode is set to None. The connector pattern of the custom VI must match exactly the connector pane of PostCopyScripting.vi under <labview>\ProjectTemplates\Source\Core\Actor Framework\scripting\TwoTasksMetaDataObj\ <CustomVIPath>scripting/CreateBlankProject.vi</CustomVIPath>
<SortPriority> Defines the sort priority of the project template in the Create Project dialog. A lower value has higher priority. If two or more project templates have the same priority value, they are sorted alphabetically. <SortPriority>100</SortPriority>
<MetaDataClass> Specifies a relative path from <LocationPath> to a child class of MetaDataClass, which defines custom behavior for the second page of the Create Project dialog. <MetaDataClass></MetaDataClass>
<HidePrefix> Can be set to TRUE or FALSE (default), to hide the File Prefix control on the second page of the Create Project dialog. <HidePrefix>FALSE</HidePrefix>
<HideIconOverlay> Can be set to TRUE or FALSE (default), to hide the icon overlay tools on the second page of the Create Project dialog. <HideIconOverlay>FALSE</HideIconOverlay>

Source

The Source directory contains the source files for the project templates, as well as scripting tools for the project creation process.

Each template should be placed in its own directory. The project file must include all files that should be copied during the project creation process.

Scripting tools should be placed inside the same directory under scripting, but not be included in the project.

Project creation process

History

See also

External links