LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to tell if Design Time or Run Time execution of vi

Solved!
Go to solution
Highlighted

I would like have my vi behave differently if the developer presses the Run button to execute the VI vs if the vi was loaded and run by another vi or executed at Run Time.  Is there a simple way to do this? I tried the VI Server Reference (This VI) but couldn't find a property that gave me what I wanted.

 

Thanks.

0 Kudos
Message 1 of 9
(1,164 Views)
Solution
Accepted by topic author EduNI

You can use a conditional disable structure or the App.Kind property.

 

Run Time Engine.png

0 Kudos
Message 2 of 9
(1,161 Views)
Solution
Accepted by topic author EduNI

@EduNI wrote:

I would like have my vi behave differently if the developer presses the Run button to execute the VI vs if the vi was loaded and run by another vi.


Use Call Chain.  If the chain array is larger than 1, the VI was called by somebody.

 


@EduNI wrote:

or executed at Run Time.


I would use the Conditional Diagram Disable Structure for this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 3 of 9
(1,155 Views)

Thank you!  Yes, App.Kind is what I was looking for. I had seen it before but could not for the like of me find it again in the LabVIEW help! Even when using the function block search or quick drop I could not find the App.Kind. The conditional disable and call chain are also potentially very useful.  Thank to both replys.

0 Kudos
Message 4 of 9
(1,150 Views)

Does call chain work if the Vi is loaded in a subpanel?

0 Kudos
Message 5 of 9
(1,134 Views)

@EduNI wrote:

Does call chain work if the Vi is loaded in a subpanel?


It will work, but maybe not as you expect it.  If you are starting a new paralle execution of the VI (which I assume you are) then the call chain will show that VI has the top level.  It isn't being called by any other VI directly so it will be the top level.  Of course this might not be what you want.  But you can use another function like the one mentioned here to detect if a VI is loaded into a subpanel and behave differently if it is.

 

 

0 Kudos
Message 6 of 9
(1,113 Views)

@EduNI wrote:

Does call chain work if the Vi is loaded in a subpanel?


Depends how you called the VI.  If you call the VI and then get a reference to it to load it into the subpanel, then yes.  If you are dynamically calling it, I do not think it will work the way you want it.  I will need to experiment to make sure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 7 of 9
(1,112 Views)

@Hooovah, I noticed the link you provided is for LabVIEW 8.2.  I wonder if there is a "more direct" way to tell if a VI is loaded in a subpanel in newer versions of LabVIEW.  I am using version 2013.  Thanks!

0 Kudos
Message 8 of 9
(1,030 Views)

There is no new funtion I'm aware of to detect when a VI is in a subpanel but this is the method I've been using and works in 2015.  Just make a subVI of it and throw it in your reuse library for safe keeping.

0 Kudos
Message 9 of 9
(1,018 Views)