LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Dynamically call VIs

Solved!
Go to solution

Hi,
I have a problem with Dynamic Call VIs.
I need to call some vi tests from my main vi. My code works fine but when i build the project it doesn't work.
In my .exe, when i try to launch a test i get the error 1003.
My code is in the picture.
Someone can help me ?

Thank you !

 

 

0 Kudos
Message 1 of 12
(4,632 Views)

Hi Roberto,

 

is the path to your VI still correct in the EXE?

Did you include those dynamically called VIs in your EXE?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(4,621 Views)

Read GerdW's questions carefully, especially Question 1.

 

Bob Schor

0 Kudos
Message 3 of 12
(4,600 Views)

As other have said, its a good idea to add any launched by ref VIs in the always included section.

 

Check the "Additional Exclusions" part of the exe build spec too. I think there is a remove unused members which might cause the issue.

 

0xDEAD

 

 

Message 4 of 12
(4,583 Views)

If you can, I would recommend dynamically launching the VI like this:

 

VI server asynch.png

 

The static VI reference will make sure that the dynamically called VI is in the main VI's hierarchy at compile time, so shouldn't require any additional inclusions.  Set the VI reference to strictly typed for the correct connector pane interface and also use the reference to get the path on disk from a property node.  The path will update correctly regardless of whether you are running it in development environment or run-time engine.

Message 5 of 12
(4,568 Views)

Hi,

Thank you for all your helps !!

I include Vis in "always include" and set some additional exclusion (look the pictures).

I get the error 1003 after the block "Open VI Reference Functions" but the path it's correct.

i use the code in Figure 3 for the VIs path.

Is the static VI a better solution ?

How can i call N subVIs with Static VI solution ?

 

Thank you

 

0 Kudos
Message 6 of 12
(4,530 Views)

Hi,

Thank you for all your helps !!

I include Vis in "always include" and set some additional exclusion (look the pictures).

I get the error 1003 after the block "Open VI Reference Functions" but the path it's correct.

i use the code in Figure 3 for the VIs path.

Is the static VI a better solution ?

How can i call N subVIs with Static VI solution ?

 

Thank you

 

0 Kudos
Message 7 of 12
(4,530 Views)

I usually launch N VIs using something like this in a loop.

In this example, I don't expect expect any data back from the VI (not through its connector pane anyway, I give it some queue and event references, so it communicates over those channels..

 

I think option 0x100 rather than 0x80 is call and collect.

 

When spinning up clones like this (especially as fire and forget) I usually include some "self killing zombie" code in the launched modules.

If the module detects that the main VI has stopped, the module will suicide itself after a short delay. Nothing worse than a zombie infestation.

 

0xDEAD

 

launch.PNG

Message 8 of 12
(4,521 Views)
Solution
Accepted by topic author RobertoCo

@RobertoCo wrote:

I get the error 1003 after the block "Open VI Reference Functions" but the path it's correct.


Are you sure about that?  If you include the VIs in the executable, then the relative path between the main VI and the called VI will not change between the development system and the runtime engine.  So there is logic there you should get rid of.

 


@RobertoCo wrote:

Is the static VI a better solution ?

How can i call N subVIs with Static VI solution ?


If you will only call 1 VI (even if just clones of a single VI), then I would go with the Static VI Reference method.  It just eliminates a lot of complications that you are running into.  Just drop a Static VI Reference onto your block diagram and then drag your VI into it.  You will probably then want to right-click on it and choose "Strictly Typed VI Reference".


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
Message 9 of 12
(4,489 Views)

Thank you. It's work now.

 

"Are you sure about that?  If you include the VIs in the executable, then the relative path between the main VI and the called VI will not change between the development system and the runtime engine.  So there is logic there you should get rid of."

 

My error was different relative path between development system and runtime system. (Look picture).

 

Thanks at all for your patience and help !!

 

Download All
0 Kudos
Message 10 of 12
(4,478 Views)