Example Code

List Shared Variables and Get Data

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 programmatically gets the URL and Data for any Shared Variable that is Double Data Type on a specified Variable Server chosen by the user.


Description: This example programmatically gets the URL and Data for any Shared Variable that is Double Data Type on a specified Variable Server chosen by the user.    The output is an array of all the Shared Variable URLs and another array of the Data Values corresponding to the URL at the same index.


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


Steps to Implement or Execute Code: Run the VI. This will not return any variables that are not of the Double Data Type.  However, the URL Property will return all Shared Variables.  It was coded this way so that the data array would contain meaningful information.  You can change the code to receive any Data Type.


Additional Information or References:

List Shared Variables and Get Data FP.png

 

List Shared Variables and Get Data BD.png


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

 

Thanks!
Bob H
Applications Engineer
National Instruments

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

Comments
VRspace4
Member
Member
on

The VI example works fine and is very helpful, but I can't seem to find the 'Variable Server' control from the front panel controls list. Couldn't find it in the control search tool either. Is it under a different name?