LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

own ini file is not referenced when I build an .exe file ??

Hi there,

i have a application which uses a vi. This vi reads some parameters from a file to the application.

When I build a exe file the path to the .ini file is empty ? an error occurs.

What can I do to solve this

The structure is as following

- main.vi
- sub folder: - get_from_ini_file.vi
- file.ini


get_from_ini.vi searches in the same directory as it is itself, but when I build an exe file it doesn't work,
I debugged where it searches for the file, and the path was empty?

I'm using LabView 6i

Thanks for help of any kind.

Markus
0 Kudos
Message 1 of 6
(3,241 Views)
This is a mistake everyone seems to make when they first use the app builder. The path to a built VI is different. For example, in the development environment, the path might be c:\folder\example.vi but with a built VI it will be c:\folder\app.exe\example.vi. The fix is to add an extra strip path. You can have your VI work in both development mode and as a built app by using a property node app.kind. It will return invalid, development system, run time system, etc., so you can wire the output to a case structure that does the extra strip path.
Message 2 of 6
(3,232 Views)
Hi Dennis,

how can I do this, what you explain. I'm using a node which returns me the actual path of the vi, in the same folder is the .ini file so it should be independent where the vi is stored.

But I believe you that my solution will not working, but I do not understand how to change it, that it works.

Must I add the /app.exe/ in the path? but the path I get is empty?

Could you please change my vi as you think that it should work? I do not know witch nodes I have to use, that it works.

Thanks for your help

Markus
0 Kudos
Message 3 of 6
(3,204 Views)


@balucharly wrote:
Hi Dennis,

how can I do this, what you explain. I'm using a node which returns me the actual path of the vi, in the same folder is the .ini file so it should be independent where the vi is stored.

But I believe you that my solution will not working, but I do not understand how to change it, that it works.

Must I add the /app.exe/ in the path? but the path I get is empty?

Could you please change my vi as you think that it should work? I do not know witch nodes I have to use, that it works.

Thanks for your help

Markus




You have to stripp the additional app.exe when running in the Runtime system. There's a property node which you can test for the actual environment. If this yields a Run Time System you just do an additional "split path"...


I hope that helps a bit,
Carsten
Message 4 of 6
(3,200 Views)
Here's a picture of what I mean. I can't save your VI to version 6. The function does return the path of the VI but like I said, the path is different when built. It is no longer in the same folder as the ini file. It is part of the exe file (which is really an llb).
0 Kudos
Message 5 of 6
(3,192 Views)


@Dennis Knutson wrote:
Here's a picture of what I mean. I can't save your VI to version 6. The function does return the path of the VI but like I said, the path is different when built. It is no longer in the same folder as the ini file. It is part of the exe file (which is really an llb).


Thanks Dennis,

I will try this out, you will hear from me until next week.

I'm not working till then, have to do some social work.

Thanks

Markus
0 Kudos
Message 6 of 6
(3,185 Views)