06-21-2018 02:33 PM
Hi,
I have an issue where I have the following main.vi contained in a project (MainProject.lvproj). This main.vi calls A.vi contained in project (HelperProject.lvproj) by reference.
Attachment 1):
A.vi calls a vi from the toolkit "ni-industrial communications for ethernet/ip" .
When I run the main.vi in development environment everything works as expected. The issue that I am facing is when I run the build (runtime environment), it gives me an
Error 1003: Open VI Reference in main.vi<APPEND> VI Path: <b>C:\Debug\HelperProject\LabView Files\A.vi</b>
I also noticed this in the dependencies folder of HelperProject
Attachment 2):
Any hints on how can I solve this? I have attached all of the necessary files in Attachments. I am currently using LabView 2015 64 bit SP1. Help would be appreciated.
Solved! Go to Solution.
06-21-2018 03:17 PM
In your executable you need to get the correct path to the VI you want to run inside the executable. You can use a property node and get either "path" or "name" for the Open VI Ref function. You may need to change your VI Refnum to a Static VI Reference first, I'm not sure.
06-21-2018 08:28 PM
I use Start Asynchronous Call all the time, but rarely Call by Reference. However, the rules seem similar for both. I've found the following works equally well in Development and in Executable modes:
Bob Schor
06-22-2018 08:14 AM
@Gregory wrote:
In your executable you need to get the correct path to the VI you want to run inside the executable. You can use a property node and get either "path" or "name" for the Open VI Ref function. You may need to change your VI Refnum to a Static VI Reference first, I'm not sure.
I take the same approach. It also makes the build process easier since LV will be able to figure out that staticly linked VI should be included in the build.
Now if you are targeting a VI from one application that is served by another, you will have to make sure the target VI has a FP.
Ben
06-22-2018 10:06 AM - edited 06-22-2018 10:07 AM
@Gregory wrote:
In your executable you need to get the correct path to the VI you want to run inside the executable. You can use a property node and get either "path" or "name" for the Open VI Ref function. You may need to change your VI Refnum to a Static VI Reference first, I'm not sure.
Thank you so much for this! It worked well.
Just out of learning curiosity, can you explain me what did the Static Reference>PropertyNode-Path do vs the normal path.
06-22-2018 10:08 AM
@Ben wrote:
@Gregory wrote:
In your executable you need to get the correct path to the VI you want to run inside the executable. You can use a property node and get either "path" or "name" for the Open VI Ref function. You may need to change your VI Refnum to a Static VI Reference first, I'm not sure.
I take the same approach. It also makes the build process easier since LV will be able to figure out that staticly linked VI should be included in the build.
Now if you are targeting a VI from one application that is served by another, you will have to make sure the target VI has a FP.
Ben
Hey Ben,
Yes my VI did have a front panel. Thank you for your help! 🙂
06-22-2018 10:21 AM
VIs in a exe have a different path than when in the development environment. Using that approach lets you cheat and not have to worry about the path inside the exe.
If you really want to see how the path changes, put an indicator on the front panel of the target VI and display the path.
If you can get away with, cheat.
Ben
06-22-2018 10:26 AM
@Ben wrote:
VIs in a exe have a different path than when in the development environment. Using that approach lets you cheat and not have to worry about the path inside the exe.
If you really want to see how the path changes, put an indicator on the front panel of the target VI and display the path.
If you can get away with, cheat.
Ben
Wooha! I didn't know that. I have like 10 other VI's in the project which works well with the method that I used. Only the one I highlighted and included in the HelperProject didn't work (A.vi) because it had an dependency. I will definitely try to put an indicator and read more into it 🙂