LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check if subVI is executable before actually executing it

Solved!
Go to solution

I have a process chain where each process is a SubVI, and a main VI calls them one after one via open VI reverence -> Method "Run VI" (I don't know the exact english names)

 

This works great, since I can easily add new steps or change the order of steps.

 

However, during development it often happens that a SubVI is not executable e.g. due to an open connection. And it is a bit nasty to find this out while running the (time consuming) process chain.

 

I already check if the SubVI files exist, but is there a way to check if they are executable without actually executing them?

 

This example DOES EXECUTE the VIs, if possible:

 

screen.PNG

 

 

 

 

 

 

Download All
0 Kudos
Message 1 of 4
(2,632 Views)
Solution
Accepted by topic author Sebastian.Weber

Hi Sebastian,

 

create a new VI called "VI Tree.vi" in your project.

Drag&Drop all of your "subVIs" into this VI.

When the "VI Tree" is executable all of your subVIs are executable.

Do this ALWAYS before distributing your code.

 

As a responsible programmer you do only distribute tested code, don't you?

 

Btw. there is a property "Execution.State" (deutsch: "Ausführung.Status") of the VI. This one says "bad" when the VI is not executable…

Best regards,
GerdW


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

Hi Gerd!

 

Well, the VI Tree has the disadvantage that the developer has to remember to add every single independent VI, and it is easy to forget one. Plus, who has a look at that VI Tree each time he touched one of the SubVIs? Maybe before deployment, but while development?

 

But in general I of course make VI Trees, since they also give a neat overview of a library etc.

 

However, the Execution.Status does the trick, and in principle, one could create a test tool checking every single VI in a directory. Thanks for that!

0 Kudos
Message 3 of 4
(2,604 Views)

Hi Sebastian,

 

the VI Tree has the disadvantage that the developer has to remember…

That's why I wrote "responsible programmer"… 😄

Best regards,
GerdW


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