The following is a post I recently made on the LabVIEW Idea Exchange. If you like my idea, please give it your kudos (vote) and maybe it will become a real LabVIEW feature someday.
I often find myself debugging code that seems to have "hanged" and I want to find out which VI is causing the lockup (maybe it's waiting on some event/queue/message/timeout or maybe it's stuck in an infinite/long loop). There's no really easy way to figure out which subVI (or perhaps a node) is not returning from its call.
The way that I currently do this is to start opening up VIs and looking at their "Run Arrows" (the run buttons on the VI toolbar) to see which subVIs are currently "running" (being called).
Running (Top-Level VI)
Running (subVI of a Running Top-Level VI)
<< This is what I look for
Not Running (subVI of a Running Top-Level VI)
This technique works OK, but it takes a lot of time to track down the running VI (in applications where there are LOTS of VIs), since you have to just start opening up all your VIs a looking at their run arrows.
Question: Is there any way to look at the run state of a VI using VI Server or Scripting? Unfortunately, the VI Execution.State property is "Running" for all three states shown/illustrated above (the "Idle" state is for VIs that are not reserved for execution, meaning they are not in the hierarchy of a running top-level VI). Maybe I'd also add to my feature request that it would be nice if there were a way to interrogate this state using VI Server or Scripting.
What would be nicer is if I could ask LabVIEW to Find all Running subVIs/Nodes and visualize them by their VI Hierarchy. Maybe we could have an option to show the run state in the VI Hierarchy window. And, maybe there could be a way to only show running VIs (hide all Not Running / Idle VIs).
Now, I realize that the VI hierarchy window doesn't have any way to visualize multiple subVI "instances" of a VI, but maybe that could be an option as well. Also, it would be cool if we could show "Clone" instances of reentrant VIs... but, I digress.
Also, the VI hierarchy window only shows VIs, it doesn't show nodes/functions that might be running (and what's causing my code to hang). It might be nice if we could also include nodes, at least for the purpose of helping me find out which nodes are running.
So, I'll end by just stating that I need some easier way to figure out why my application appears to have hung and I hope that this "Idea" leads to more discussion and maybe some more features in LabVIEW to help me debug and visualize my applications.
Do you have any ideas for how to better debug applications that appear to have hung? Do you have ideas for new LabVIEW features that could help?
Again, if you like my idea, please give it your kudos (vote), here in the LabVIEW Idea Exchange, and maybe it will become a real LabVIEW feature someday.
[Update 1 - Fabiola posted a great, related idea: Visualize which VIs have execution highlighting ON and be able to turn all OFF]
[Update 2 - Aristos Queue has taken the baton and run with a proposal for a compressive set of state information and debugging features in the LabVIEW Hierarchy Window]