LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Files in Executable

Solved!
Go to solution

Hi

 

I have a project where i start some files who are saved on my laptop. But when i create an executable from my LabView program everything works fine. But when i copy the files to another laptop and start my code it will not work. This is because the files aren't stored in the directory on my other laptop. So how can i define where the program should get the files on all laptops with no problems?

 

Kind regards,

0 Kudos
Message 1 of 6
(1,223 Views)
Solution
Accepted by topic author VH_NIELS

Hi VH,

 


@VH_NIELS wrote:

This is because the files aren't stored in the directory on my other laptop. So how can i define where the program should get the files on all laptops with no problems?


What about using a fixed (network) folder on your local/company file server?

What about storing/installing the files in a fixed folder available to all users of a computer, like "CommonAppData"?

What about storing/installing the files in a subfolder of your executable's installation path?

 

What have you tried so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,212 Views)

Hi

 

The goal of the executable is just to get it on an USB stick and put it into another computer and run. So ideal would be that the files are in the directories of the executable. But i don't know how to do it.

 

Kind regards

0 Kudos
Message 3 of 6
(1,203 Views)

Hi Niels,

 


@VH_NIELS wrote:

The goal of the executable is just to get it on an USB stick and put it into another computer and run.


LabVIEW executables expect the LV-RunTimeEngine installed on the computer to be able to run, so just putting a LabVIEW-made executable on a memory stick might not work in all possible situations…

 


@VH_NIELS wrote:

So ideal would be that the files are in the directories of the executable. But i don't know how to do it.


Include those additional files in your project. Then add them as "Always required" in the AppBuilder specs for your executable to get them added to the "data" subfolder next to your exe…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(1,198 Views)

Hi

 

And is there an posibility to use files without an path? Just by the name off the file?

 

Kind regards

0 Kudos
Message 5 of 6
(1,194 Views)
Solution
Accepted by topic author VH_NIELS

@VH_NIELS wrote:

Hi

 

And is there an posibility to use files without an path? Just by the name off the file?

 

Kind regards


Kind of, it'll be a relative path. It's good to use App-dir and build a path to reduce mistakes though.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 6
(1,157 Views)