LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi waiting to run (objective function)

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,

0 Kudos
Message 1 of 7
(3,453 Views)

Dear ghighuphu,

 

I really like to help you with your issue but some more informations are necessary.

 

I assume you use this optimization function:

 

Constrained Nonlinear Optimization VI

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

0 Kudos
Message 2 of 7
(3,426 Views)

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,

0 Kudos
Message 3 of 7
(3,405 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 7
(3,389 Views)

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!

0 Kudos
Message 5 of 7
(3,358 Views)

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,

0 Kudos
Message 6 of 7
(3,347 Views)

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

0 Kudos
Message 7 of 7
(3,332 Views)