LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does "Set Tag" and "Get Tag" methods work in EXE file

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.

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

Set\Get Tag works on available objects, but the persistence doesn't.

 

AFAIK, the RTE is not capable of saving VIs at all.

0 Kudos
Message 2 of 7
(3,662 Views)

You could get it to work for dynamically loaded VIs.  Note however that after you set the tag, you must save the VI.

Clipboard.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 7
(3,624 Views)

 Is there a reason you are trying to do this instead of just using an INI file?

Matt J | National Instruments | CLA
Message 4 of 7
(3,614 Views)

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

Clipboard.png


As mentioned, that doesn't work in the RTE:

Save Instrument.png

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...

0 Kudos
Message 5 of 7
(3,601 Views)

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) 

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

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.

 

 

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