03-25-2021 03:37 AM
I have a Main VI which calls a SubVI via an Async Call or just normal (selectable by boolean input, see example). The SubVI increments a number of the Main VI and returns it. However, I noticed when I press right on the Front Panel UI, the execution of the Asynchronous Call halts. When I use the 'Highlight' function, the data seems to stop at 'Open VI Reference'. As soon as the right click is released, the VI continues executing. I tried also on a different PC, with no different effect.
The only post I found so far that is similar: https://forums.ni.com/t5/LabVIEW/LabVIEW-hangs-at-RunVI-invoke-node-when-right-click-menu-is/m-p/356...
There somebody used an Invoke Node an experienced the same issue, and his workaround was to use an async call, however I am having the same issue with async call, so I am unsure what could resolve this issue?
Any ideas?
Solved! Go to Solution.
03-25-2021 03:50 AM
The Run method needs an idle 'root loop'... Menus (right click and VI) block the root loop.
You'd have to use Call By Reference (Call and Forget, Call and Collect), that doesn't use the root loop.
Other solutions are possible, but real dynamically calling any VI just isn't possible, as far as I know. You need to know the connector pane to make a dynamic call that doesn't use the root loop.
Sad, but true...
The idea Run As SubVI method might help. In the future, if\when it's implemented.
03-26-2021 10:24 AM
Call by reference did not resolve the issue for me. However, I found an interesting article by NI that allowed me to resolve the issue:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MqkSAE&l
I opened the VI reference at the very beginning of runtime as this 'Open VI Reference' function seems to run in the UI loop. I attached the revised version which now works.
03-26-2021 10:48 AM
OK, so the open reference uses the root loop as well.
03-26-2021 11:32 AM
Oops I just realized that I attached the wrong link. I found the necessary hint here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000001Dd6ISAS&l