Example Code

Browse for Shared Variables in a directory or file 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

Description

1. Overview

This example helps to locate all shared variables used by a VI or by all the VIs inside a directory specified and display them in a list.

 

2. Description

A shared variable is a memory space that you can read data from and write data to. You can read and write shared variables on a single computer with single-process shared variables or on multiple computers with network-published shared variables, which publish data over a network using the NI Publish-Subscribe Protocol (NI-PSP). Use shared variables to publish only the latest values in a data set to one or more computers.
This example helps to locate all shared variables used by a VI or by all the VIs inside a directory specified and put them into a list. Then the list can be grouped by a VI (it displays all shared variables inside a VI selected from the list) or by a shared variable (it displays all VIs using a shared variable selected).

 

3. Requirements

  • NI LabVIEW Base Development System 2012 (or compatible).

 

4. Steps to Implement or Execute Code

  1. Download the compressed file and unzip its contents.
  2. Open the project "Browse for Shared Variables LabVIEW 2012 NIVerified.lvproj"
  3. Run the VI: "Get Binding List.vi".
  4. Write the VI or Folder to search for variables.
  5. Click Get Shared Variables to display the found variables (this step might take a while depending on the directory's size).
  6. Select a different display method with the List By enum control.
  7. Click Stop to finish.

 

5. Additional Information or References

Browse for Shared Variables LabVIEW 2012 NIVerified.PNG

 

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

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

Comments
BetaCommunityCo
Member
Member
on

Doesn't seem to always work

I really like the idea of the VI, I can see it being very valuable. However, I set it to run on some installed examples (C:\Program Files\National Instruments\LabVIEW 8.2\examples\Shared Variable) with my LV 8.2.1 and it doesn't seem to find all four variables being used within that folder. Additionally, if I set it to search for shared variables within a certain VI, for instance Front Panel Binding Client.vi in that same folder, then it doesn't find any shared variables even though there are two in the VI.

I haven't looked too much at the code to see yet why it's doing that...