LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a vi tell if it was called or just run?

Can a vi tell if it was called (perhaps through the use of something akin to
the property node) or else is running as a top-level vi?

Note that this would have to work even in the presence of memory-resident
callers of the vi that were not running (this precludes the use of the
property node "callers" data item).

I'd also like to rule out additional front panel controlls that are only set
by callers.

TIA,

--
Warren Massey
Massey4@LLNL.Gov
0 Kudos
Message 1 of 4
(2,727 Views)
Found it myself after some more looking. It is indeed a property node item
under Execution - State.

"Warren Massey" wrote in message
news:38cd5c40@newsgroups.ni.com...
> Can a vi tell if it was called (perhaps through the use of something akin
to
> the property node) or else is running as a top-level vi?
>
> Note that this would have to work even in the presence of memory-resident
> callers of the vi that were not running (this precludes the use of the
> property node "callers" data item).
>
> I'd also like to rule out additional front panel controlls that are only
set
> by callers.
>
> TIA,
>
> --
> Warren Massey
> Massey4@LLNL.Gov
>
>
0 Kudos
Message 2 of 4
(2,727 Views)
Warren Massey wrote:

> Can a vi tell if it was called (perhaps through the use of something akin to
> the property node) or else is running as a top-level vi?
>
> Note that this would have to work even in the presence of memory-resident
> callers of the vi that were not running (this precludes the use of the
> property node "callers" data item).
>
> I'd also like to rule out additional front panel controlls that are only set
> by callers.
>
> TIA,
>
> --
> Warren Massey
> Massey4@LLNL.Gov

Check out the property node with the property "State"
This returns the following:
"Bad"
"Idle" - in mem but not running
"Run Top Level" - Running as the Active Top Level VI
"Running" - This seems to say that a Top Level has reserved it
to "possibly" be run. Not that it actually
IS running.

Kevin Kent
0 Kudos
Message 3 of 4
(2,727 Views)
Warren Massey wrote in message
news:38cd5c40@newsgroups.ni.com...
> Can a vi tell if it was called (perhaps through the use of something akin
to
> the property node) or else is running as a top-level vi?
>
> Note that this would have to work even in the presence of memory-resident
> callers of the vi that were not running (this precludes the use of the
> property node "callers" data item).

As well as using property nodes, you can also use the "call chain" function;
this simply returns an array of VI names from the vi back up to the top
level. If the array has a size of 1, then you are the top level.
0 Kudos
Message 4 of 4
(2,727 Views)