LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file io problems

Hi there,

I'm all new to the labView programming "language" and i have a problem.
For my internship I'm creating a program and I'm having a problem creating files and folders.

When I run the program from the labView programming enviroment it creates the files and folders perfectly.
I compiled the program with the Application Builder and i ran it again. Then it says that it cant find the specified file and/or folder. It does that because it cant create it, but i dont know why.

Is someone familiar with this problem and can you please help me?
0 Kudos
Message 1 of 7
(3,085 Views)
No way to answer that unless you give us more info.

Are you reporting errors? If not, why not? If so, do you get an error message? What is it?



How are you making the path to the folder? Can you attach the simplified code? Or at least a picture of the relevant parts?


One trap to avoid falling into is this:

If you use THIS VI's PATH to start building a path, remember that you have to strip TWICE if you're in a LLB, TWICE if you're in an EXE, but ONCE if you're in a VI file (not in a library).

For that reason, I suggest never using stand-alone VI files, always use libraries.


Ask a clearer question and you'll get a clearer answer.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 7
(3,077 Views)
Hi !

This happens for a very simple reason. When you build an .exe, all your VIs are put in a "container" (I heard that was a llb, but I'm not sure), so Im pretty sure that you have wrong paths.
Just had "strp path" to get out of that "container" Smiley Wink

Hope this help !

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 3 of 7
(3,080 Views)
When you build an .exe, all your VIs are put in a "container" (I heard that was a llb, but I'm not sure)


Indeed, an EXE container is just like an LLB container.


If you use THIS VI'S PATH from a VI in a library, you get:
Drive \ Parent Folder \ Folder \ MyProgram.llb \ This VI.vi


If you use THIS VI'S PATH from a VI in an executable, you get:
Drive \ Parent Folder \ Folder \ MyProgram.exe \ This VI.vi


But if you use THIS VI'S PATH from a VI in a stand-alone file, you get:
Drive \ Parent Folder \ Folder \ This VI.vi



To get to the Folder, you have to STRIP PATH once from a VI file, but TWICE from a VI in a LIBRARY and TWICE from a VI in an app.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 7
(3,070 Views)

The "container" is actually the exe file but the exe file is actually an llb.

When you use Get Current VI's path on a VI in development mode and the VI exists in a folder and not an llb, the path would be something like c:\folder\example.vi. When you build an executable "built.exe", the path to the VI is c:\folder\built.exe\example.vi. So, in order to determine the actual folder you're in, you have to do an extra strip path. The way to write your VI so that it works in both development mode and as an exe is to use an application property node and the property application kind.  When built, the property will return a value of "Run Time System". Wire the output of the property node to a case statement and create the case "Run Time System". Put the extra strip path inside this case and make another, empty case the default.

0 Kudos
Message 5 of 7
(3,069 Views)
The way to write your VI so that it works in both development mode and as an exe is to use an application property node and the property application kind. When built, the property will return a value of "Run Time System".


Actually, I find it easier to just avoid stand-alone VI files.


Use a library, then the EXE and LLB are exactly the same.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 7
(3,059 Views)
My feeling on llbs can be found here. Imho, the only reason for llbs was to get around the old limitation of the 8.3 file names when LabVIEW was introduced on windows and as a distribution tool.
0 Kudos
Message 7 of 7
(3,052 Views)