LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why open new clone

Hi,

 

I start a reentrant VI (an engine) as it can be seen on the screenshot. After this calling VI is executed, the target engine VI runs and for stopping, expects a notification via notifier. Another VI sends this notification to the engine VI, and the engine stops. BUT. The clone of the engine VI remains in the memory, and when I call the start VI (screenshot) again, a new clone will be opened. If I do it 100x, then I will have 100 engine VI clones in the memory - at least I see all the front panels of the 100 clones.

 

My idea is to remove the engine VI from the memory (dispose) after executed. How to do that?

 

 

I already tried to pass TRUE to the AutoDisposeRef, but it still doesn't work 😞

 

RunReentrantVI.JPG

0 Kudos
Message 1 of 8
(2,871 Views)

You need to somehow close the references.  Setting the AutoDispose to TRUE should do that.  But if it doesn't, then just close the reference when you are done manipulating it.  The VI should still be running until it is told to stop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(2,843 Views)

And also, as long as the front panel of the clone is open, then it is still in memory.It does not matter of the clone is running or not.

To remove the clone from memory you need to close the front panel.

0 Kudos
Message 3 of 8
(2,825 Views)

And moreover you are using an out-of-date method!

 

The better practice would be to open a strictly typed ref to your reentrant vi with 0xC0 flags set during your application launch (This buries the time needed to populate the clone pool at launch) then pass that ref to an Asynchronous Call By Reference (Fire-n-Forget) when you need to spawn the process and just use the con-pane to pass in your values.

 

 

And, Just to top off the dessert I just gave you, the refnum out of the Open reference node is a ref to the clone instance not the vi! Greatly simplifying calling the same clone over and over and protecting you from "Starting" a running clone instance.  (Errors don't sound nearly as bad as engaging the starter on a running automoble)


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(2,803 Views)

Hi,

 

thanks for the great answers!

 

Now it looks to work with the out-of-date method, opening the VI Ref with the parameter 0xC0. I still have questions:

- Where is the flag 0x80 documented??? What does it mean? In the help of the Open VI Ref the options are listed only until 0x40.

- does the "Asynchronous Call By Reference" launch the VI on the same way, as RunVI with Wait Until Done = False? I just want to launch the engine and leave the launcher VI.

 

Greetings from Germany

Gyula

0 Kudos
Message 5 of 8
(2,769 Views)

ACBR and a few supporting open vi ref flags, was introduced with 2012.  What version are you using?  


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(2,752 Views)

Oh, I'm using LV2010 SP1. Maybe it's time to upgrade to 2014...

Message 7 of 8
(2,748 Views)

@Madottati wrote:

 

- Where is the flag 0x80 documented??? What does it mean? In the help of the Open VI Ref the options are listed only until 0x40.

- does the "Asynchronous Call By Reference" launch the VI on the same way, as RunVI with Wait Until Done = False? I just want to launch the engine and leave the launcher VI.


Here is the help from 2011

 

http://zone.ni.com/reference/en-XX/help/371361H-01/glang/open_vi_reference/

 

And here is the 2010 version

 

http://zone.ni.com/reference/en-XX/help/371361G-01/glang/open_vi_reference/

0 Kudos
Message 8 of 8
(2,720 Views)