LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV Bug ? Confused : Exec.State property for a closed vi ?

Solved!
Go to solution
I am a bit confused by the Exec.State property :
Trying to find the status of a VI, I use a continuously running loop in a Spy.vi to get the FP.Open status and the Exec.state of the spied VI, as shown in the example below.
Works fine.

Except when the spied vi is closed : the FP.Open tells that the front panel has been closed :), but the Exec.state is still "Run top level" or "Idle" depending on the state the VI was before closed :(.

Nearly sure that this should not be the right answer...

Any comments ?
Ben ?
Chilly Charly    (aka CC)
0 Kudos
Message 1 of 4
(4,188 Views)
Solution
Accepted by topic author chilly_charly
Closing a VI while it's running does not stop its execution.

Try putting an indicator on the iteration terminal of the monitored program and modify your Spy.vi to get the value of the iteration terminal using an invoke node and the Get Control Value. (see attached image)

Close the running VI with it running and you'll see the spied iteration terminal continue to increment.

The 'Bad' State indicatates a VI that cannot run.

So what you are seeing is exactly what should be happening.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 4
(4,188 Views)
I agree!

There is another factor here as well.

Your VI is opening a ref to the sub-VI. As long as the ref is open the VI will stay in memory.

The attached VI and jpg illustrates a way of watching VI's come and go without locking them in memory.

If you comibine Ed's example with my demo you will be able to see the VI stay alive and drop out when done.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 3 of 4
(4,188 Views)
Thanks Ed!
The demo is really excellent.
I really enjoy being taught that I still ignore things that should be basic for an oldtimer !
Should I apologize somewhere ? 🙂

Thanks also to Ben...

I'll try to catch another one... 😉

CC
Chilly Charly    (aka CC)
0 Kudos
Message 4 of 4
(4,188 Views)