LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Distinguish top-level VI activation by 'Run' button rather than by 'Run VI' method

During execution of some VIs (top level VIs) I need to determine whether they where activated by a user clicking the Run botton, or programatically by some other VI using the 'Run VI' method.
Anyone has got an idea how to do that?
0 Kudos
Message 1 of 6
(2,797 Views)
Hi
 
One idea is to pass a reference of the calling vi to the calles subvi. If it is started manually, the reference should be not valid.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 6
(2,791 Views)
Using a 'Run VI' method does not pass any default parameter to the referenced VI, so this sort of work-around requires some nasty methodology of the called VIs (such as the exact name of the Refnum control ...) and of the callinfg procedures (Open FP, write to Refnum control, only then do the 'Run VI' method)
I am looking for a robust option! any other ideas?
0 Kudos
Message 3 of 6
(2,787 Views)

Just have a look at this simple example. Instead of using the "Run VI" method, you could also use the "Call By Reference Node" function.

As you can see in called.vi, the boolean indicator is light, if it is started manually.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Download All
0 Kudos
Message 4 of 6
(2,783 Views)

In order to use the 'Call By Reference Node' you need to have the exact terminal structure of the called VI in advance, which is definitely not a robust option.

In addition, if you want a certain "Caller" to operate on various VI types, you would have to create an exhaustive selector, and it would always be limited only to the set of terminal structures you have hard-coded into it.

There are plenty of other good reasons for using the 'Run VI' method, and I am certainly not willing to give it up.

 

0 Kudos
Message 5 of 6
(2,778 Views)
Ok - but if you look on such restrictions and criteria, I can't understand why a user can start a vi himself. Then I would make one executable, from which all is controlled, opened and so on. No "dev-mode" vis with run, run-continuously, stop, pause, etc.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 6
(2,772 Views)