LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a variable reference to a typedef to update automatically

In my main program I have an instance of a strict typedef containing a cluster.
I create reference to the instance and saves the reference in a local or global variable, ref_variable.
I am now able to conveniently access the cluster from anywhere in the program by calling the ref_variable
and using a property node.
This is all good untill I change something in the cluster type def, then the changes do not propagate down and updates the ref_variable !
If I manually re-create the ref_variable it updates fine.
Is there any way to get the ref_variable to update automatically from the typedef?
If I could get this to work I could obtain a nice and clean program structure with a very easy to read main program.
 
The attached code will explain better:
0 Kudos
Message 1 of 3
(3,228 Views)
Instead of using a local or global, try an LV2 style global. Because it uses a placed control instead of a reference (which are typed), the control will automatically update when you change your typedef'd control.


Message Edited by JeffOverton on 03-28-2008 08:47 AM
Message 2 of 3
(3,223 Views)
Make the reference a type def. as well. So each sub VI will have the type
def'd control as input/output. Updating it will only be a little more
work... Using a LV2 style global is also a good idea.

Regards,

Wiebe.


Message 3 of 3
(3,204 Views)