Example Code

Programmatically create a LabVIEW VI

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview:  This example shows how to create a very simple VI.


Description

With the release of the LabVIEW Scripting API, you are now able to programatically build up VIs. This example shows how to create a very simple VI, and it doesn't take long to see just how complicated it can get. The process is logical, you think of it just as if you were manually programming a VI, but managing the references you open to the various objects adds overhead. This is just to show how you can start to use the Scripting API but to be honest, most of us will not use it to build VIs for us because it is quicker and easier to do it ourselves!


Requirements: LabVIEW 2012 (or compatible). Hardware: none.


Steps to Implement or Execute Code:

1. Run the VI.
2. Select the folder where to save the new VI.
3. The new VI with default test name executes the adding of two numerics.


Additional Information or References: 

 

The power of the Scripting API can be quite clearly seen when you start to think about creating your own add-in development tools rather than programatically building VIs for you. Take a look at the following links as these show how we can all use LabVIEW Scripting to speed up our development.

 

The Scripting Springboard

One of the great things about scripting is how easy it is to automate some tedious tasks in the process of developing code. The Scripting Springboard is a template thats enables you to create your own developement tools in minutes.

 

JKI Right-Click Framework

This framework allows you to install new features into LabVIEW right-click menus.

 

LVSpeak

Automating VI development through speech.

 

Programmatically create a LabVIEW VI BD.png


**This document has been updated to meet the current required format for the NI Code Exchange.** 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Jeff M
NI Employee (retired)
on

For further resources on VI Scripting, check out the API Community: http://decibel.ni.com/content/groups/labview-apis