LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW hangs on right click when using asynchronous call

Solved!
Go to solution

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?

0 Kudos
Message 1 of 5
(1,661 Views)

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.

0 Kudos
Message 2 of 5
(1,647 Views)
Solution
Accepted by MaHo12345

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.

0 Kudos
Message 3 of 5
(1,583 Views)

OK, so the open reference uses the root loop as well.

0 Kudos
Message 4 of 5
(1,578 Views)

Oops I just realized that I attached the wrong link. I found the necessary hint here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000001Dd6ISAS&l

0 Kudos
Message 5 of 5
(1,572 Views)