From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1003: On open vi by reference in runtime environment

Solved!
Go to solution

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):

Snippet.png

 

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):

Untitled.png

 

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. 

 

0 Kudos
Message 1 of 8
(5,271 Views)
Solution
Accepted by topic author sridatta04

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.

 

Capture.PNG

Message 2 of 8
(5,260 Views)

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:

  • Drop a Static VI Reference.  Browse for the VI that you want to "reference".  As a bonus, if your VI has an Icon, the Static VI Reference will show that Icon (helping with self-Documentation).
  • Right-click and make this a Strictly-Typed Reference.
  • Wire it to a Property Node.  You'll get a "strictly-typed" node, but that's OK.
  • Wire the Path property to Open VI Reference.  Wire the Static Reference to the terminal on top of the Open VI Reference.
  • The VI Reference can now start Call by Reference or Start Asynchronous Call.  The same code will work in both Development and Execution code.

Bob Schor

Message 3 of 8
(5,229 Views)

@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.

 

Capture.PNG


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

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

@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.

 

Capture.PNG



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.  

0 Kudos
Message 5 of 8
(5,193 Views)

 


@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.

 

Capture.PNG


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! 🙂 

0 Kudos
Message 6 of 8
(5,191 Views)

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

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

@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 🙂 

0 Kudos
Message 8 of 8
(5,184 Views)