Programmatically Change Properties for Shared Variables in LabVIEW

Updated Jul 13, 2020

Reported In

Software

  • LabVIEW

Issue Details

I created a library that contains multiple objects, such as shared variables and controls. I want to dynamically change the properties of shared variables. What should I do?

Solution

Get the library reference through the Library.Open invoke node. You can get a reference to each item through this library reference. 
The important thing to do before changing properties is to check what type each item is. You can get the type of each item in the form of a string through the LibraryitemTypeString property.
Finally, get a variable reference through the VariableReference property. Now you can access the properties of each variable through this.

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.