01-14-2019 08:58 AM
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
01-14-2019 09:02 AM - edited 01-14-2019 09:04 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-14-2019 10:24 AM
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
01-14-2019 12:32 PM
@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.
01-14-2019 12:48 PM
@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
01-14-2019 12:52 PM
@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.
01-18-2019 02:31 AM
I thought I had a screen of the Error but I was wrong sorry
01-18-2019 06:26 AM
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...