LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Files that stick with VI

I am creating a program that allows the user to change color profiles on waveform graph properties. The user can then save a particular profile, change the colors back to default and then access those colors later in the future. 

I have created ".ini" files and save them to my local computer, but I want to be able to give this program to different people and have them be able to access other color schemes.

 

Thanks 

0 Kudos
Message 1 of 3
(765 Views)

You can place the file next to the executable (or in a special folder next to the exe) and use the application directory constant to locate it. If building an installer, make sure to include them in the build spec.

 

Depending on your needs there are also other special locations that could be used, e.g. depending if all users should share the same profiles or if each user wants their own.

 

 

0 Kudos
Message 2 of 3
(743 Views)

Here's a way to Have Your Cake and Eat It, Too.

 

I'm assuming you are developing a LabVIEW Project, specified by a .lvproj file.  I further assume that you have most (all?) of the VIs, TypeDefs, etc. associated with the Project in a Folder, perhaps inside the LabVIEW Data folder in "My Documents".

 

Open the Project and "Add Folder" the Data Folder.  It will appear in the Project Explorer.  You can access it by building a Path whose "Path" part is the File "constant" "Application Directory".  Any file that you put into this Data Directory can be opened and read by specifying its File Name and the Path to the Data Directory.

 

Now, suppose you build an Executable.  LabVIEW creates, next to the Executable version of your Application, a Data Folder (which is normally empty) that should mimic the contents of the Data Folder you just created in the LabVIEW Project Folder.  The File Constant "Application Directory" that you used in the Development Process now (in the Executable version) points to (you guessed it!) the Data Folder associated with the Build.  No need to change any code when going between Development and Executable.  You should, of course, check (particularly if you re-build the Executable 3 months later, after you've connected a lot of Data files in the Executable version) that the contents of the Source and Executable Data Folders are consistent (whether you need them to be identical or not is up to you, of course).

 

Bob Schor

0 Kudos
Message 3 of 3
(625 Views)