09-17-2010 06:33 AM
Solved! Go to Solution.
09-17-2010 06:38 AM
This is the solution.
Norbert
09-17-2010 09:31 AM
You can use tags to store data inside the VI, but if you want it accessible after you close the VI, you are going to have to save the VI (this can be done programmatically using the Virtual Instrument.Save method. Note that this will not work in an EXE, because it can't save the VI.
See here for more details - http://forums.ni.com/t5/LabVIEW/Darren-s-Weekly-Nugget-04-13-2009/m-p/888538#M401396
09-17-2010 11:22 AM
Is it really necessary to store the data within the VI itself? Could you not store the data in a file, like a config file, and just retrieve it when you start the VI again?
09-17-2010 11:14 PM
I need to save the info in the VI itself because i will not transfer the configuration files to another machine. Also I want it to work in exe too.
09-18-2010 12:34 PM
There's no way to make this work in an EXE. The only way to save information in a VI is to SAVE the VI, and the EXE can't do that. If you want this to work in an EXE, use configuration files, just like everyone else.
If you don't want to manage files, you can try writing the information to the Windows registry using the registry VIs, but this solution is Windows only. You may also run into access rights issues if you don't handle things properly.
09-18-2010 12:40 PM
And just to clarify - you can READ the tag in an EXE. You can WRITE the tag in an EXE. You just can't save its value for the next time.
09-18-2010 01:51 PM
@LabVIEWan wrote:
I need to save the info in the VI itself because i will not transfer the configuration files to another machine. Also I want it to work in exe too.
Why can't you transfer the configuration files to another machine? If you install the exe on another computer you can also install the config files. An installer can also copy configuration files.