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: 

How can I programmatically run a VI in a LabVIEW project?


@bruce008 wrote:

billko,

 

The reason I want to run our VI right after I open it is that people are testing our source code as we're writing it at a rather rapid pace, and we don't want to have to build an executable each time. We have a really long build time and a really short development cycle time lately!


Hey, I appreciate you taking the time out to explain it to me!  Kudo for helping a fellow forum member (me)!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 16
(1,209 Views)

@bruce008 wrote:

Jeff,

 

I'd like to be able to programmatically run or not, although your solution would work if I only wanted to run. I want the people who test my code to run it from the source (not the executable), in which case it would run, or I might want to edit that source, in which case it would not run.


Have you built a unit test for the vi?  This is the type of thing the Unut Test Framework is exceptionally good at.  At which point your "Launch vi becomes a call to "Run tests from File.vi" and View Results.vi


"Should be" isn't "Is" -Jay
0 Kudos
Message 12 of 16
(1,206 Views)

Jeff,

 

I don't have the Unit Test Framework. Is there a way to run a "unit test" without it?

 

0 Kudos
Message 13 of 16
(1,200 Views)

If you have the NI Developer Suite, then you have the Unit Test Framework.  It is one of those things I've really been wanting to really play with.  It is actually quite simple to setup.  Everything is done in the project.


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
0 Kudos
Message 14 of 16
(1,197 Views)

Do look at the shipping examples for the UTF the example projects are really nicely done (Athough, they mostly got a large boost in the 2013 example upgrade with clearer documentation so if you have 2013.....)  The 2012 examples appear to source from a "pre silver" version based on FP Background color.

 

But seriously the price uplift from LabVIEW Professional to Developer Suite is cents on the dollar for the LabVIEW addons it encludes.  Plus the LabWindows/CVI and associated other stuff makes it (IMHO) very attractive.  Although, I personally have a Design Reference Library Ala the Alliance Partnership so I do not need to debate the costs with my boss.  You may have a harder timeSmiley Wink

 

To answer the other question.  You do need a UTF License to run unit tests.  I just opened a example project in the next cube over (he is stuck on a "Full" LabVIEW dev key) the project opens with warnings on the UTF files.


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 16
(1,187 Views)

This is what I did.

Have vi run when opened. 

One shortcut string.

execute labview include two arguments.  Project file and vi file.

"C:\Program Files (x86)\National Instruments\LabVIEW 2013\LabVIEW.exe" "C:\_096 Rev F.lvproj" "C:\_096 Rev F.vi"

 

Hope that works.

Message 16 of 16
(1,002 Views)