Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Creating Template VIs

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

You can create custom template VIs to avoid adding the same components to the block diagram or the front panel each time you want to perform a similar operation.

Complete the following steps to create a new template based on an existing VI template.

  1. Select File»New to display the New dialog box.
  2. From the Create New list, select a template VI from the From Template directory similar to the one you want to create.
  3. Click the OK button. The front panel and block diagram of the template VI appear.
    Note Note  When you create a VI from a template, LabVIEW does not apply the options you select for new VIs in the Options dialog box.
  4. Edit the VI.
    Tip  You can add templates as subVIs to a template VI. To add a template as a subVI, open the VI template and drag the VI icon in the upper right corner of the front panel or block diagram window to the block diagram of the top-level template VI. When you create a VI from a template that contains template subVIs and save the VI, LabVIEW prompts you to save each template subVI as a VI.
  1. Save the VI as a template.
  1. Select File»Save As to display a file dialog box.
    Note  If you have already saved the template VI, selecting File»Save As displays the Save As dialog box instead. Select the Copy and Substitute copy for original options and click the Continue button to display the file dialog box.
  2. (Optional) Navigate to the labview\templates directory if you want the template VI to appear in the New dialog box with the template VIs LabVIEW installs. To set the block diagram preview, save an image of the block diagram as a .png file in the labview\templates directory. Append d to the name of the VI to create the .png filename. For example, if you want to create the block diagram preview of Test.vi, save an image of the block diagram as Testd.png in the labview\templates directory. This block diagram preview and the VI description appear in the Description section when the VI template is selected in the Create New list.
    Caution   Do not save your own VIs and other files in .llb files installed with LabVIEW.
  3. (Windows) Select Template VIs from the Save as type pull-down menu. (Mac OS X and Linux) Include the template VI file extension (.vit).
  4. Enter the name of the template VI and click the OK button.

You also can change the .vi extension to a .vit extension in the file system to convert an existing VI to a template VI.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit