09-03-2014 10:53 AM
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 😞
09-03-2014 12:44 PM
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.
09-03-2014 02:00 PM
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.
09-03-2014 03:41 PM
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)
09-04-2014 01:53 AM
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
09-04-2014 03:30 AM
ACBR and a few supporting open vi ref flags, was introduced with 2012. What version are you using?
09-04-2014 03:34 AM
Oh, I'm using LV2010 SP1. Maybe it's time to upgrade to 2014...
09-04-2014 08:25 AM
@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/
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord