LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically store some information in the VI itself

Solved!
Go to solution
I need to store some data (could be numeric/string/boolean) within the VI itself during runtime. So that next time when I run the VI I can retrieve that data from the VI itself. Is there any technique for doing this..?
0 Kudos
Message 1 of 8
(3,203 Views)

This is the solution.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 8
(3,199 Views)

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


___________________
Try to take over the world!
0 Kudos
Message 3 of 8
(3,173 Views)

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?

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 8
(3,158 Views)

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.

0 Kudos
Message 5 of 8
(3,134 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 6 of 8
(3,111 Views)

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.


___________________
Try to take over the world!
0 Kudos
Message 7 of 8
(3,108 Views)
Solution
Accepted by topic author Flamboyant

 


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

 

0 Kudos
Message 8 of 8
(3,100 Views)