LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unique way of referencing controls?

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.

0 Kudos
Message 1 of 7
(3,542 Views)

Here is a discussion on saving and restoring controls that might answer your questions...

 

http://forums.ni.com/t5/LabVIEW/Save-restore-all-numeric-controls-values-to-from-file/m-p/832990/pag...

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 7
(3,532 Views)

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

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

Ben is making the assumption that you will fully understand that entire nuggetSmiley Wink. 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.

0 Kudos
Message 4 of 7
(3,502 Views)

@for(imstuck) wrote:

Ben is making the assumption that you will fully understand that entire nuggetSmiley Wink. 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. Smiley Happy

 

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

 

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

@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. Smiley Happy

 

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 Smiley Surprised

0 Kudos
Message 6 of 7
(3,483 Views)

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 🙂

0 Kudos
Message 7 of 7
(3,468 Views)