LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

STOP Button for DLL Call

I have a VI that calls a DLL. The function in the DLL takes a long time to execute (sometimes up to 30minutes). I would like to create a CANCEL button on the front panel so that the DLL returns prematurely.
Even a quit button that doesn't display the "Reseting VI" dialog would be sufficient.
0 Kudos
Message 1 of 2
(2,589 Views)
Lucy,

I am answering this question on the forum as well so that others can have access to it as well.

If you run your DLL in the UI Thread (in the configuration dialog box for the Call Library Function), then if the call blocks, the UI will too. If your DLL is known to be threadsafe, then change UI Thread to Reentrant. This will cause the DLL call to run in the execution system that the node is located in. If you want it to run in a different execution system than the default Standard, make the Call Library Function its own subVI and change the execution system to other1 or other2 in VI Properties >> Execution. This way, when the DLL call blocks, it will block the other thread and not the Standard thread or the UI thread.

Randy Hoskin
Applications Engineer

National Instruemnts
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(2,589 Views)