11-08-2018 02:45 AM
Hi,
Each component in LV has methods "Get Tag" and "Set Tag" - they are useful for storing some information for individual controls. When using property Persistent set to TRUE the value stored in the tag will remain even after the project was closed and opened again. This allows to store the front panel last values, some user choices, etc.
The question is - do these methods work after the project was compiled to EXE file?
Thanks.
11-08-2018 03:54 AM
Set\Get Tag works on available objects, but the persistence doesn't.
AFAIK, the RTE is not capable of saving VIs at all.
11-08-2018 11:24 AM
You could get it to work for dynamically loaded VIs. Note however that after you set the tag, you must save the VI.
11-08-2018 01:52 PM
Is there a reason you are trying to do this instead of just using an INI file?
11-09-2018 02:20 AM
@paul_cardinale wrote:
You could get it to work for dynamically loaded VIs. Note however that after you set the tag, you must save the VI.
As mentioned, that doesn't work in the RTE:
So it would require opening an application reference to the development environment, dynamically loading the VI there, change tags and have the development environment save it... Might as well run the entire application in development environment...
11-09-2018 06:57 AM
Hi Jacobson,
Do you have some example how to save the last user set values from multiple controls from multiple VIs into INI file? Set tag would be very elegant solution but as already pointed out it will not work in RTE (EXE)
11-09-2018 09:43 AM
Check out this library for reference files:
https://github.com/Carya-Automatisering/Configuration-File-Library
It does not OOTB (re)store all controls from an array of VI references. That would be pretty trivial though. There are VI's to store recursive controls from an array of references. All controls (recursively, in clusters and tabcontrols) that following the (adjustable) label format (section_key) will be stored. So it would be easy to take an array of VI refs, and in a for loop get their panels and all controls from each panel.