Example Code

Programatically Creating Shared Variables using LabVIEW

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

  1. Overview
    • This example shows how to programatically create and add shared variables to a library file using Invoke and Property Nodes.
  2. Description
    • A valid project and variable library must be specified before the VI can be ran. The file path can be typed in, browed for, or simply dragged from the desktop/folder onto the front panel.
    • This example create a Variable named "My Variable". The Variable name has to be unique, so check that no other variables with the same name exists in the project.
  3. Requirements
    • LabVIEW 2012 (or Compatible)
  4. Steps to Implement or Execute Code
    • Choose a valid project and library file
    • Run VI
    • Check in the Project Explorer for the new shared variable beneath the Shared Variable library
  5. Additional informations or References

Programmatic Shared Variable Creation LV_2012_NI_Verified.png

 

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

Chris Van Horn
Applications Engineer

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