LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Call by reference when using .exe

When using an exe file it's Path change meaning when I use Applications path. as the .exe isnt in the same folder as the Main.vi the path that is linked to call VI by reference as well change. Isn't there a way so that I always get the right path no matter when using Main.vi or the .exe Application.

By right path I mean .../Projectfolder/SUBVI/subvi.vi . I could write it manually but I have no guarantee that the Project folder with always be in the same place

0 Kudos
Message 1 of 8
(2,771 Views)

That's why you shouldn't rely on the path to a VI but instead use the static VI reference, and reference the VI by name.  Here is an example.  Paths are good for things like plugin architectures, but if your VI is just a VI you were already including it makes it easier.

0 Kudos
Message 2 of 8
(2,769 Views)

I was using static reference but it worked only once and then it stopped working.

I had no idea why.

I found a fix for my problem but I don't like using inelegant solutions

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

@77maxmustermann wrote:

I was using static reference but it worked only once and then it stopped working.

I had no idea why.


This is not normal, so obviously something is wrong. Make sure to provide details so we can help you getting the static reference to work correctly. Most of my executables use static references and I never had a problem.

0 Kudos
Message 4 of 8
(2,728 Views)

@altenbach wrote:

@77maxmustermann wrote:

I was using static reference but it worked only once and then it stopped working.

I had no idea why.


This is not normal, so obviously something is wrong. Make sure to provide details so we can help you getting the static reference to work correctly. Most of my executables use static references and I never had a problem.


Unless the targeted VI is broken or the icon connector has changed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 8
(2,723 Views)

@Ben wrote:

@altenbach wrote:

@77maxmustermann wrote:

I was using static reference but it worked only once and then it stopped working.

I had no idea why.


This is not normal, so obviously something is wrong. Make sure to provide details so we can help you getting the static reference to work correctly. Most of my executables use static references and I never had a problem.


Unless the targeted VI is broken or the icon connector has changed.

 


... but that would already break it in development mode. I thought the problem was after creating an executable, but maybe I misread. In any case, it's a problem that can easily be solved.

0 Kudos
Message 6 of 8
(2,721 Views)

I thought I had a screen of the Error but I was wrong sorry

0 Kudos
Message 7 of 8
(2,687 Views)

As long as the VI is in memory, you can use it's name iso it's path.

 

You can make sure the VI is in memory in several ways.

 

This might not be applicable to your situation, but you haven't mentioned it...

0 Kudos
Message 8 of 8
(2,681 Views)