LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing custom shared variables data types

Solved!
Go to solution

My application includes a library containing a number of single-process shared variables. I use type defs to create the shared variables "from custom control." I know that the shared variables do not auto-update from the type defs, so I update the shared variables (right click, properties, data type) whenever I update the type defs.  However, if I make a change to a type def that does not change the data type, such as changing the labels of the controls, these changes will not be reflected in the shared variable.  The shared variable window data types list contains entries for each previous update, indicating it is using previous entries.  How can I make the shared variable properties popup window "forget" my previous errant type defs without removing the variable altogether? Removing and replacing would be troublesome, as the variable is referenced throughout my project.

 

Thanks,

 

Wes

0 Kudos
Message 1 of 5
(3,536 Views)

What if you make a more substantial change like doing something to actually change a datatype (double to ext, U16 to U32) along with the non-critical change. (Of course this might break a lot of code.) Then later go back and change the datatype again back to what is was.  (Hopefully fixing any broken code, and keeping the desired non-critical changes to the shared variable still stuck.)

0 Kudos
Message 2 of 5
(3,530 Views)

Ravens Fan,

 

I tried that approach originally, and the non-critical change does take effect with the new datatype, but once I revert to the original datatype the variable reverts to its previous definition.  In fact, even if I remove the variable from the library altogether and create a new one, the new variable sticks to the previous non-critical definition.  It appears that I will need to access whatever part of Labview is keeping track of the custom types to clear them out, but I haven't discovered how to do that.

 

Cheers,

Wes

0 Kudos
Message 3 of 5
(3,510 Views)

Perhaps it is the shared variable engine.

 

Maybe you have to specifically undeploy the library, or do something to stop the shared variable from being tracked in the shared variable engine.  (Remove process in distributed system manager ???) 

0 Kudos
Message 4 of 5
(3,502 Views)
Solution
Accepted by topic author Womack

The variable is not found in the Distributed System Manager, or the Variable Manager, and undeploying did not resolve.  However, I found that closing Labview entirely and restarting clears the memory of previously used custom data types that the library sees.  Thus, the successful workaround I found is:

 

1 - Make a non-trivial change to the data type of the type def (per your suggestion). Save.

2 - Redefine the variable vis-a-vis the type def.

3 - Save the project. Close and restart labview.

4 - The old type def is now cleared.

5 - Revert the non-trivial change of the type def, implement the trivial change, and save.

6 - Redefine the variable using the now-correct type def. Viola!

 

Thanks!

0 Kudos
Message 5 of 5
(3,492 Views)