11-01-2010 11:20 AM
I am wondering how to uniquely identify controls, even after a labview session (and my vi) has been closed and reopened. Control references change each time this happens, so I don't think a control refnum would work.
The reason I want this is that I write all the front panel controls values into a binary INI file so I can reload previous states (datalogging basically)-- using Get All Control Values and then Set Control Value, but the names of the controls might change in the future.
I noticed that there can be two identically named (the Label.Text property) controls but Labview can tell them apart.
I am using Labview v7.1. Is it possible? If not, I will just have to make sure to never change the control names.
11-01-2010 11:43 AM
Here is a discussion on saving and restoring controls that might answer your questions...
11-01-2010 12:14 PM
My Nugget on exploiting Control refs may serve as inspiration at the least and re-use, if someone will back-save it for you, maybe.
The big question hinges on your data strctures since arrays of cluster of arrays of clusters ... was addressed using re-currsive calls and in older version os LV "Acalls B that calls A..." was not supported.
if nothing else it may give you an idea.
Ben
11-01-2010 12:25 PM - edited 11-01-2010 12:27 PM
Ben is making the assumption that you will fully understand that entire nugget
. I'm still working on it and it's my fourth read.
I like using the XML to Cluster VIs, however I believe those use variant data in some form, where as ben's method allows you to not worry about that if it changes in future versions.
11-01-2010 12:35 PM
@for(imstuck) wrote:
Ben is making the assumption that you will fully understand that entire nugget
. I'm still working on it and it's my fourth read.
I like using the XML to Cluster VIs, however I believe those use variant data in some form, where as ben's method allows you to not worry about that if it changes in future versions.
Try to write a Nugget that can appeal to developers at all levels and I suspect you find yuorself in a similar situation.
The linked Nugget also uses an ini file as per the O/P's request.
And yes you are correct that changes to the type are handled automatically and do not cause an error.
Ben
11-01-2010 12:55 PM
@Ben wrote:
Try to write a Nugget that can appeal to developers at all levels and I suspect you find yuorself in a similar situation.
The linked Nugget also uses an ini file as per the O/P's request.
And yes you are correct that changes to the type are handled automatically and do not cause an error.
Ben
Very true, and a bit off topic but it gets even more hairy on RT systems when you can't use property nodes ![]()
11-01-2010 01:19 PM
Why not using Open G library??
They have two VI's "Read INI cluster" & "Write INI cluster" to read and write some control values into an INI file.
That's how I do it all the time 🙂