11-18-2013 03:50 AM - edited 11-18-2013 04:00 AM
Dear Users,
I have an optimization process using unconstrained nonlinear optimization and an objective function. The only place I use that objective function is in a subVI (let's call it Optimise.vi), where I supply that to the optimization subVI (which is LabVIEW native). After running my whole program, the Optimise.vi stops and is in the idle state. But the objective function and all of its subVIs are in a running state, and their run-arrows display "SubVI waiting to run" or "Run" (always with an arrow inside an arrow). I could check on the state of the two VIs using a VI by Marche at http://forums.ni.com/t5/LabVIEW/SubVI-Waiting-to-Run/td-p/49432.
The execution of the Optimise.vi and the objective function is set to "shared clone". If I set the execution of the Optimise.vi to "non-reentrant", then the objective function also ends in the idle state. But my program runs longer, and I would like to avoid that.
Is this behavior bad? Should I care about it?
Cheers,
11-19-2013 08:09 AM
Dear ghighuphu,
I really like to help you with your issue but some more informations are necessary.
I assume you use this optimization function:
http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/constrained_nonlinear_optimization/
Did you create the objective function from the template located here: labview\vi.lib\gmath\NumericalOptimization\cno_objective function template.vit ?
In the template the execution settings should be right.
For further troubleshooting a screenshot would be nice. Feel free to come back to me.
Kind Regards,
Vanessa
AE Munich
11-19-2013 09:14 AM
Dear Vanessa,
thank you for your kind response.
Yes, please, I used the template. The template is set to be non-reentrant. My objective function is set to be a "shared clone". But even, if I set it to be non-reentrant, it stays on running. Of course, the total execution time is huge in this case -- that was the reason I changed the execution to "shared clone". Other than that I do not see any differences between the properties of the two VIs.
This is even stranger: when I run my Optimise.vi, in which the "Constrained Nonlinear Optimization VI" is located, the objective function does not remain stucked (i.e. it ends in idle). When I call my "Optimise.vi" within another VI, the objective function keeps displaying "running". The "Optimise.vi" is the only VI, where the the objective function is located, too (says the project explorer).
I am not sure, how could screenshots help. And of which part should I create a screenshot. I would not like to share the VIs.
Cheers,
11-19-2013 10:14 AM
Are you using TestStand to call these VIs?
Usually, that "arrow in an arrow" displays that the VI is reserved to run. So you cannot call that VI directly, but have to use the caller which marked the subVI as reserved.
This is common to LabVIEW modules called by TestStand, hence my question.
Also, working with reentrant VIs, you usually don't(cant) track each clone individually. So this could also indicate, that single clones are still active.
Nevertheless, as long as you do not have a problem with it (despite not being able to execute the subVI individually), i wouldn't bother too much about it.....
Norbert
11-21-2013 01:34 AM - edited 11-21-2013 01:39 AM
Dear Norbert_B,
no, I do not use the/a TestStand.
Yeah, it started to be clear to me, that it is not necessarily the objective function that is "hanging" (waiting to run), but some of its subVIs, that is still running in the background. I launched the VI Hierarchy window but I could not find the running VI yet.
I am making my program "VI analysis tool" compliant, and here and there I re-run the program to check on possible unwanted changes. When I am about to make a modification in the still running SubVI: I save everything, close and reopen the project to allow for modifications (the diagram of the running VI is unmodifiable... 🐵 )
Thank you for your effort!
Cheers!
11-21-2013 03:09 AM - edited 11-21-2013 03:15 AM
Dear users,
I do have a new piece of information: the subVIs remain haginging (= waiting to run) only, when I run my Optimisation.vi in a parallalised for-loop. If the for-loop is run in serial, then no subVI remains hanging and all ends idle. Most of the subVIs in my for-loop are shared clones and there are some small subVis that are not yet reentrant. (Nevertheless, the execution of the parallelised for-loop is already visibly quicker.)
Cheers,
11-22-2013 04:16 AM
Dear ghighuphu,
thanks for the further informations.
I tried to reproduce your error. I took the example "Optimization and Calibration with Simulation - Calculate Parameter.vi" and modified it. Unfortunately, I cannot observe what you see. Even some parallel for loops did not end in a hanging objective function. Do you have another idea what to test?
Would it be possible to post a project which reproduces your behaviour? Without this it is hard to support you.
Kind Regards,
Vanessa