LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically run VI not working after built

Hi all, am trying to build an application that allows a user to select a VI(strict typedef) to run.

My code works in the development environment but refused to run after I compiled it.

Please see as attached.

 

 

Can you help to advise what can I do to make them run?

 

Thank you

 

Regards,

Stonewall

0 Kudos
Message 1 of 6
(1,991 Views)

I do not have LV 2018 but the most common cause of that symptom is the paths to VIs change in an exe.

 

The simplest solution is to use static references to the dynamic VI and let LV worry about including the VI and its path.

 

If the target VIs show the front panel, make sure you check the option to include FP in the build spec.

 

Ben

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

Hi Stonewall,

 

What do you mean by compiled it? Did you ctrl + click the run arrow to do a force compile?

Or do you mean building into an application? If this, then it's possible the dynamically called VIs were not included in the build.

 

Can you attach a single zip file containing your code saved for LV 2016 or earlier?

0 Kudos
Message 3 of 6
(1,980 Views)

You can't load VIs by path when you make them into an EXE unless you build them into the EXE, and even then the path is different and you can't browse to it.

 

Your best bet is to include strictly typed static VI references in your code, which will ensure the VI is built in your EXE.  Put down a "Static VI reference" from the Application Control palette, browse to the path of one of your dynamic VIs, and then right-click it to select the "strictly typed" option from the right-click menu.

0 Kudos
Message 4 of 6
(1,977 Views)

@Kyle97330 wrote:

Put down a "Static VI reference" from the Application Control palette, browse to the path of one of your dynamic VIs, and then right-click it to select the "strictly typed" option from the right-click menu.


Instead of browsing, you can also drag the VI from several places, such as a subVI on the block diagram, the icon in the top right of an opened VI, or the project directory. I only mention because it was quite a revelation when I first found this out 🙂

0 Kudos
Message 5 of 6
(1,972 Views)

Thank you all for providing me with the solution. My application is now working

Smiley Happy

0 Kudos
Message 6 of 6
(1,912 Views)