Example Code

Get Shared Variables Names in 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 VI gets the names of all the variables contained in a library 

 

2. Description: 

The properties for shared variables are defined in the Variable class property node. In order to access the Variable class, a reference to the shared variable must be connected to the variable class property node.

This code uses VI Server to access the variables in the Library.  First, a library is opened.  Then references to the items in the library are returned.  Then each variable reference is extracted and the name of the variables is returned.

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Unzip "Get Shared Variable Names LabVIEW 2012 NI Verified.zip"
  2. Open and run "Get Shared Variable Names LabVIEW 2012 NI Verified.vi"
  3. Once the vi has finished executing, the name of all variables contained in Library.lvlib in the project will be shown in the front panel

5. Additional Information or References 

VI Snippet

 

Snippet.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.