LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to automatically load a configuration .ini file on VI startup?

Solved!
Go to solution

Hey everyone,

 

I have the following VI in one of the projects I am trying to work on. It is loading a configuration parameters for a camera. This VI comes as preconfigured from the manufacturer, but it uses this File Dialogue Express VI, which will prompt always to select the .ini file neede.

 

I want to remove it and load the file automatically on VI startup. So far so good, but how do I load the file in case when this VI will be built as an application and the application installed on a different PC? I am not familiar with Application builder, but how to include this configuration .ini into the installation folder, so that it can be loaded always properly when used on different computers?

 

P.S. The actual .ini manipulation is in the sub-VI load from ini.

0 Kudos
Message 1 of 5
(417 Views)
Solution
Accepted by topic author grumpy_numpy

Hi grumpy,

 


@grumpy_numpy wrote:

I am not familiar with Application builder, but how to include this configuration .ini into the installation folder, so that it can be loaded always properly when used on different computers?


I see two simple options:

  1. add that "camera" ini file as an additional file to your AppBuilder configuration. Now you can define the location of that additional file, default is a "data" subfolder next to your executable…
  2. add the content of that "camera" INI into the ini file of your executable, so your executable only needs to read it own ini located in the same folder right next to the executable…

 

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 5
(413 Views)

Hey Gerd,

 

I love your solutions! Always so simple. Thanks a lot!

 

I will build it quickly and test asap.

 

bests

 

Georg

0 Kudos
Message 3 of 5
(409 Views)

Hey Gerd,

 

getting the following error:

 

grumpy_numpy_0-1624441531306.png

 

I used the Current VI path VI.

grumpy_numpy_1-1624441572770.png

 

0 Kudos
Message 4 of 5
(384 Views)

Hi grumpy,

 


@grumpy_numpy wrote:

I used the Current VI path VI.

grumpy_numpy_1-1624441572770.png

 


Why do you do that? (And why don't you use BuildPath to build a path???)

Did you verify the path which is created this way? It seems (very) unreasonable as it is shown in that error message…

 

Using CurrentVIPath is wrong: use the ApplicationDir file constant to get the path of the executable!

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 5
(373 Views)