12-16-2025 05:07 PM
Hi all,
I am experiencing some weird behavior in one of my applications and I was wondering if anyone here had any idea why. Here is the problem:
I have a vi that gets loaded into a subpanel. The indicators of that vi don't display the data I wired to them unless I am watching the indicators when they update. In other words: If the vi is not loaded into the subpanel, the indicators are not visible and they do not update when new data is wired to them. When I insert that vi into the subpanel, the indicators display the wrong values until the next time they are updated.
I have attached some simple code that demonstrates this behavior. It is saved as LabVIEW 2015, but I originally wrote the code in 2022 Q3.
The attached code will start a vi using call by reference. After 6 seconds the vi will be inserted into the subpanel, and you will see that all values are default until the next time they are updated.
Is this normal? It feels like a bug. I have tried a lot of things to resolve this, including all applicable solutions of this knowledge article:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kISeSAM&l=en-US
I have also tried settings the indicators, "Synchronous Display" property, and I have tried to force updates using the, "Defer panel updates" property. The only thing that has worked is writing values to the indicators constantly in order to get them to update after I start looking at them.
12-16-2025 07:43 PM
Not sure what's the reason behind it, but it works if you use Run VI Method instead.
12-17-2025 01:42 AM - edited 12-17-2025 01:48 AM
Hi,
I don't know what is your purpose with this program, but if you make a few changes, it will work fine.
First, in your program, you won't see the values the array takes because it only displays them when the VI execution ends, so you would never see them in your program.
Second, the “i” indicator starts at 4 because in your main VI you wait 6.1 seconds before displaying the VI, and the secondary VI runs 4 loops before you diplay it during that 6.1 waiting time.
Here are some changes you can make.
Best regards.
12-17-2025 07:39 AM
I've used sub-Panels in several LabVIEW Projects. In all cases, the VI that was loaded into the sub-Panel was only called while in the sub-Panel. You are calling it before it is placed in the sub-Panel -- I'm not sure why that messes up communication, but I also don't know why you need to do that. The contents of my sub-Panels are often State Machines being run by the "calling program", so after doing the Insert VI to embed the (not-yet-running) routine you want in the sub-Panel, I send the "Initialize" command to the VI in the sub-Panel (which would be your "6-second" routine) and follow up with whatever else I need to send.
Why can't the sub-Panel routine do the 6-seconds by itself? The idea is to keep all of the code running in the sub-Panel running only in the sub-Panel. At least, this technique has worked well for me ...
Bob Schor
12-17-2025 09:58 AM
My guess, it basically has to do with the fact that the front panel isn't initially loaded into memory. The compiled code is trying to be smart about making copies of data. If the front panel doesn't need to be loaded, each control/indicator only needs one copy of data. If the front panel does need to be loaded, each control/indicator needs two copies, one for the the actual data and one for the displayed FP object. Since you aren't loading the FP into memory until later, that second copy is only getting made when you do, and the initial value of that second copy is the default value of each control/indicator.
As for why Run VI works, I'm not sure. But, in your called VI, doing anything that loads the front panel into memory without actually opening it will work to make the indicators show with the expected values initially. For example:
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
12-18-2025 06:09 AM
I'd say it's expected behaviour. Why update a front panel that isn't shown? That's just unnecessary work.
12-18-2025 06:41 PM
I believe that the "Run VI" node works because any VI that runs needs a source for data from the inputs on its connection pane. A subVI gets them from the block diagram that calls it, as well as VIs that are called via the "Call by reference" node. The "Run VI" call has no such block diagram source, so it likely loads the diagram to get the values from that. Just a guess though.
At any rate, this behavior is not really a "bug", just an unintended consequence of optimization.
Perhaps you could try a workaround instead. Insert the VI in a subpanel immediately instead of waiting 6 seconds, but use a different method to make the sub-panel not visible to the user until you're ready. Example options:
There's probably even more options than those 3...
12-19-2025 07:43 AM
I'd guess that if you want to force it to update control even though it's not visible you can use Value property nodes in the hidden VI, this'd be one of the few times when it's ok to use those. 🙂