LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI configuration (Application)

Hello
I'm developing an application, that will be a stand alone aplication (built from LabVIEW).
There are a few configuration parameters, that must be loaded in the application the first time it's run. This is solved by running a subVI, where all configuration parameters must be changed.
The problem is the following. When it's not the first time the application is run, the configuration values from the previous run must be conserved. how can I do this?
And another problem. It's possible to add an element in the menu of the application named "calibration", that when it's selected a new subVI is loaded?

Thamks for your help!!!
0 Kudos
Message 1 of 9
(3,843 Views)
I would suggest that you use the configuration file VIs, available from the File I/O palette. You can use these VIs to read and write configuration parameters, which makes it easy to preserve your data between sessions.

If you need to preserve complex datatypes between runs then you may wish to read and write these data types to a separate file using "flatten to string" or "flatten to XML", both which are accessible from the "Advanced >> Data Manipulation" palette.

For your final question, you can create custom run-time Menus for your VIs using "Edit >> Run-time Menu..." Using the Event Structure allows you to catch a Run-time menu selection event and then load a subVI or perform any other operations you wish.

-Robert
Message 2 of 9
(3,843 Views)
Thank you Robert, I will try doing all this things
0 Kudos
Message 3 of 9
(3,843 Views)
Hello Robert

I have tried, making a new run time menu, but how can I detect the event of selecting the menu?
Thanks again
0 Kudos
Message 4 of 9
(3,843 Views)
You have two events for menu selection. They are Menu Selection (User) and Menu Selection (App). Both events return the Item Tag and MenuRef. You can then use the Get Menu Item Info function. Look at the shipping example called Menu Selection with Events.
0 Kudos
Message 5 of 9
(3,843 Views)
thank you very much!! now it works...
0 Kudos
Message 6 of 9
(3,843 Views)
Hi again
How can I write this files in the current directory? I will make an installer when application has finished, and want the configuration files to be written on this directory, without prompting the user
0 Kudos
Message 7 of 9
(3,843 Views)
You can use the file primitive "Current VI Path", but since the VI is inside the executable you will have to strip the path twice to get the directory the executable resides in. This way you can save files in the same location as the executable.

Note that when testing this in the development environment, the VI may reside in a different folder structure than your final built application - so make sure to test the built app for proper functionality.

-Robert
0 Kudos
Message 8 of 9
(3,843 Views)
Thanks, I should have search it myself instead of asking... Now everything is solved.

Esther
0 Kudos
Message 9 of 9
(3,843 Views)