LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a working executable

Solved!
Go to solution

When in development mode my project works perfect.  When I try to develop the executable, the vi's that I have loading programmatically won't start working at all.
  If you look at the attachment, I load separate vi's into memory and they start running once the are loaded.  As they run, the main calling vi populates the information from global variables that have new information in them.  Once the called vi is completed, I remove the vi from memory. 
In the executable, the program just hangs when that called vi is supposed to automatically start working.  I am probably having an issue understanding how to set up the build.  Help is appreciated.  Thank you.

0 Kudos
Message 1 of 8
(3,252 Views)

Maybe the path to that VI is incorrect, why not use a path relative to the EXE?

What error information do you get?

0 Kudos
Message 2 of 8
(3,231 Views)

The executable is in the same path as the vi so that isn't the problem.  I also get no error message.  The vi progresses up until that point.  It just waits at that moment that the other vi should be launching. 

0 Kudos
Message 3 of 8
(3,222 Views)

zip all of your files and attach the project.

 

one of two things is likely your cause:

 

1) you're not explicitly including these VIs in the "always include" section. as you're calling them dynamically, the build specs don't know the need to bring them in so they simply don't exist

 

2) the relative path is changing slightly due to the build and you'll need to account for that

0 Kudos
Message 4 of 8
(3,197 Views)
Solution
Accepted by topic author Big_Guy

If you'd use static VI references, you wouldn't have this problem.

 

But if you can use static VI references, you wouldn't need dynamic loading at all. Then again, if you use dynamic VIs on normal VIs (not reentrant clones), it can almost certainly be avoided altogether.

 

What's wrong with placing the VIs on the diagram? Why load\start them dynamically?

0 Kudos
Message 5 of 8
(3,175 Views)

@Big_Guy wrote:

The executable is in the same path as the vi so that isn't the problem.


No it's not. (or it depends on which VI you are referring to)

 

When developing in the IDE, the VI is at path A.  In an executable, the Excutable may be at path A, but then the VI is at path A\VI.vi.  Paths relative to this will be wrongunless you take care of the differences in VI path (Not the same as EXE path) which occurs during building an executable.

0 Kudos
Message 6 of 8
(3,172 Views)

From your image, the first issue I see is you are using an absolute path.  If the VI is living outside of the executable, then use Application Directory to get the folder of the executable and then use Build Path to create the path to the VI you want to run.  If your dynamic VI is included in the executable, then use Current VI's Path and then use Strip Path and Build Path to create the path to the VI you want to run.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(3,170 Views)

I went ahead and added the vi to the diagram and restructured some of it.  I had great results from there and the executable was created.  Thank you for your help.

0 Kudos
Message 8 of 8
(3,134 Views)