LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variables within nested libraries

Solved!
Go to solution

I am creating libraries containing libraries containing shared variables. The purpose is to group hierarchically different variables in categories.

LabVIEW_2018-01-30_15-16-38.png  SystemManager_2018-01-25_11-50-47.png

 

If I deploy my container libraries from the IDE, all is fine. I can do that right-clicking deploy in the project tree, and I can do it programmatically using Deploy Libraries.vi in the DSC palette.

I'm not able to do it in a built application. A complete example is posted here on LAVA.

I even tried to build a packed library out of my container .lvlib. Even in the IDE, Deploy Libraries.vi is able to deploy its inner components, but not the outer container (Error 7 occurred at Invoke Node in PRC_Deploy.vi->NI_DSC.lvlib:Deploy Library.vi).

What am I doing wrong and is there at all something I can do to get a portable variable hierarchy?

0 Kudos
Message 1 of 3
(1,909 Views)
Solution
Accepted by topic author Enrico_Segre

From what I could find this seems to be somewhat of a known issue although I could get a simple example to work on my computer if everything was set up in a very specific way.

 

1. In the Source Files tab, expand HierarchicalVariableLibrary and make sure to include FirstVariables.lvlib and SecondVariables.lvlib

2. In Source File Settings tab set the Destination of these libraries to the Support Directory

3. In Shared Variable Deployment, enable Deploy shared variable libraries at application execution and select the top level library only (HierarchicalVariableLibrary in this case).

 

My support directory was the <Application>\data folder although I'm not sure if it matters. Let me know if that works for you.

Matt J | National Instruments | CLA
Message 2 of 3
(1,861 Views)

2. In Source File Settings tab set the Destination of these libraries to the Support Directory


Indeed, with HierarchicalVariableLibrary  destined to Application.exe and First & Second to Support, it works as I expected. I have now to go back to my big original project to see if all holds (perhaps even with more levels?), I'll come back if it doesn't...

Thanks, Enrico

0 Kudos
Message 3 of 3
(1,849 Views)