08-02-2011 03:54 PM
Typically, when I insert a VI into a subpanel, that VI is running continuously until the top level VI shuts down. I was wondering, though, if it would hurt to call the subpanel VI like a normal "run-once" subvi, called continuously in a loop by the parent VI.
The attached VIs provide a very simple example.
The code runs without errors, but I am wondering if there might be some caveats that I have not yet encountered. The subpanel VI will be changing execution state (running/idle) regularly; will that cause any problems, say, if I compiled it into an executable?
I realize that there are plenty of other ways to acheive this functionality--the most obvious of which is to put the indicators in the parent VI and wire them as outputs from the subvi--but please humor me. I'm asking this mostly out of general curiosity. Plus, when you have a VI with a very large number of controls/indicators, the LV compiler can be slow to save the VI, so there would be *some* benefit in pushing the indicators down to subVIs.
08-02-2011 03:58 PM - edited 08-02-2011 03:59 PM
Does it hurt to have a subpanel VI change its execution state? Dosen't hurt a bit! You will notice a slight performance hit from the sub.vi call overhead but really- this shoudn't be noticable (without looking at vi meterics)