From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a reference stored in a SubVI

Solved!
Go to solution

Hi,

 

I created the simplified attached MWE to clarify my issue.
I use a reference to access a cluster on the user interface (UI.vi) via property nodes from a SubVI (SubVI.vi).
When I start UI the reference is whitten into a reference control in the SubVI.
I use this method instead of global variables to make sure data is only stored in one place and no two conflicting copies (global variable and corresponding element on user interface) can exist.
It works fine until I change the data type of the cluster (e.g. deleting the button).

The reference in SubVI still points to a cluster of the unchanged data type and I need to recreate it manually from the UI.
Is there a way to make sure the indicator in SubVI is updated automatically?
Or should I use an entirely different technique to store and access the reference?

 

I tryed to use type definitions to solve this but they dont affect the type of the reference.

Note: In the real application I store many reference controls in a global variable to access them from different VIs.

Download All
0 Kudos
Message 1 of 13
(3,421 Views)

make the reference control (used to ass to the sub-VI) a type def.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 13
(3,417 Views)
Solution
Accepted by topic author tim.vi

"Should be" isn't "Is" -Jay
Message 3 of 13
(3,404 Views)

Perfect! Thanks for the quick solution.

It definetly helped to have the video to understand what is going on.

 

Tim

0 Kudos
Message 4 of 13
(3,382 Views)

@tim.vi wrote:

Perfect! Thanks for the quick solution.

It definetly helped to have the video to understand what is going on.

 

Tim


That's why I wasted so few words. Glad I could Help


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 13
(3,378 Views)

@Ben wrote:

make the reference control (used to ass to the sub-VI) a type def.

 

Ben


@Ben. I  reiterate .  There are times when it is easier to read your mind than your posts .  I cannot figure out what the parenthetical expression was supposed to be.   NBL brother .


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 13
(3,361 Views)

What does "MWE" mean in the original post?

0 Kudos
Message 7 of 13
(3,353 Views)

It's short for Minimal Working Example.

 

See

https://en.wikipedia.org/wiki/Minimal_Working_Example

 

This is even more helpful

https://stackoverflow.com/help/mcve

0 Kudos
Message 8 of 13
(3,328 Views)

Thanks.  I have never heard of that before.

 

It is best to avoid using TLA's unless you are sure the people you are communicating with know what they are.

 

Spoiler
Three Letter Acronyms
Message 9 of 13
(3,311 Views)

@RavensFan wrote:

Thanks.  I have never heard of that before.

 

It is best to avoid using TLA's unless you are sure the people you are communicating with know what they are.

 

Spoiler
Three Letter Acronyms

Ditto that!

 

as in....

 

"

NBL brother .

"

 

I do not follow basketball so that reference escapes me.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 13
(3,304 Views)