LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I tell when a subVI is really running?

Hello,

I have been trying to monitor when a vi in memory executes. The VI properties can tell you the state of the VI, whether it is running or not. This does no good for me because if the top level vi is running, all of the subvis are also 'running'. I would have expected the state to be in idle if the vi is not being executed.
Is there a way to detect if a vi has been called and is the current vi executing? I do understand that multiple vis can run in memory at the same time with the vi hierarchy.
Any thoughts?
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 1 of 6
(3,357 Views)
Click on the 'troubleshooting' lightbulb. It normally will tell you what vi
is running by showing a green arrow on the vi icon. I've seen it
occasionally fail to show up, but mostly it works great.

"sinequanon" wrote in message
news:506500000008000000C1750000-1042324653000@exchange.ni.com...
> Hello,
>
> I have been trying to monitor when a vi in memory executes. The VI
> properties can tell you the state of the VI, whether it is running or
> not. This does no good for me because if the top level vi is running,
> all of the subvis are also 'running'. I would have expected the state
> to be in idle if the vi is not being executed.
> Is there a way to detect if a vi has been called and is the current vi
> executing? I do understand that multiple vi
s can run in memory at the
> same time with the vi hierarchy.
> Any thoughts?
0 Kudos
Message 2 of 6
(3,357 Views)
Actually, yes that is true, but I really wanted to save that information as an array of strings. I would like to get a runtime list of VIs as they are executed in memory. This list could be used for debugging purposes for many things.
So far I have been unsucessful, but I am plugging away at it nonetheless.
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 3 of 6
(3,357 Views)
> of VIs as they are executed in memory. This list could be used for
> debugging purposes for many things.
> So far I have been unsucessful, but I am plugging away at it
> nonetheless.

I believe the state indicates all of this information. Bad means the VI
is broken. Idle means that it is not running at top-level or as a
subVI. Running indicates it is running as a subVI, and the other Run,
Run Top Level indicates that this is a top-level VI that is running.

Greg McKaskle
0 Kudos
Message 4 of 6
(3,357 Views)
Actually Greg, it does not report what I want. I wanted to know as a vi is running in memory, when it gets called. I have attached a zip file to show that the run state only means it is running in memory, but not actually executing/called in memory.
In order to accomplish this, I would need more functionality in the property nodes for a vi, or to build in a executing state into the execution state enum options.
I have tried many methods to simply get an array of strings as each vi executes in memory, but have not been as sucessful as I thought it would be. I have played around with the suspend before call, but as far as I can tell, there is nothing programatic to say step into the vi, or proceed/turn off suspend.

The profiler may be a second option which I have yet to further look at.
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
Download All
0 Kudos
Message 5 of 6
(3,357 Views)
I guess you could build a sub-vi which associates the name of its caller (use the call-chain) and the time together and then does something with this (append to a file, notify a seperately running VI, place in a queue, etc) and place this sub-vi at the beginning and/or end of each sub-vi you want to know about.
If you run the error cluster through all your VI's you could place this sub-vi to be the first and/or last item the cluster passes through
0 Kudos
Message 6 of 6
(3,357 Views)