LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set the DLL thread parameters for a DLL call that includes a dialog?

A friend of mine has written code in Java and created a DLL for me to use in LabVIEW. It works great but we have run into problems when we want to present a dialog from the DLL. The Java dialog shows up fine and returns the parameters as expected but the LabVIEW window in the background (the main window) is not updated while the dialog is up... As a result, if the Java dialog window is moved by the user it leaves white areas behind it. The interesting thing is that when the dialog is moved outside the LabVIEW area, the other applications it is moved over manage to update their windows just fine. So it seems that it is only the LabVIEW window that is affected by this lack of window updates. I suspect that the solution is something with the threads but I have not managed to figure out a solution. I have the DLL configured as non-reentrant in LabVIEW. Any clues as to what might be going on here? Thanks!
 
(PS This is my first post in quite a while. It feels good to be back on this forum DS)
0 Kudos
Message 1 of 7
(3,439 Views)
Make your DLL call reentrant and embed this DLL call to a non-reentrant VI subVI. Use always this subVI to call the DLL method and do not try to access the DLL method anywhere outside this subVI. This way you should get thread safe access to non-thread-safe DLL and still not lock your UI thread while calling the DLL.

p.s. I haven't verified if this works, please tell us if you succeeded.
--
Tomi Maila
Message 2 of 7
(3,427 Views)

Thanks Tomi! I will try this and I will report back how it goes. If there is anything that I has to be done in the DLL code, please let me know and I shall pass info that on to the author of the DLL (written in Java).

Cheers!

Message Edited by Mikael Garcia on 10-09-2006 08:10 AM

Message Edited by Mikael Garcia on 10-09-2006 08:11 AM

0 Kudos
Message 3 of 7
(3,409 Views)
An excellent answer by Tomi. As a side note, Welcome back to the forums!    Smiley Happy

-Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 4 of 7
(3,395 Views)

Thanks Matt,

I am still not used to this new forum layout but I am impressed what I have seen so far. I didn't think there was any problems with the old style (~2004?)  but I see many things you have improved on already!

I gave Tomi the high rating his reply deserves. It is the valuable information exchange from persons like him that makes this forum what it is! Thanks guys!

0 Kudos
Message 5 of 7
(3,386 Views)

Tomi,

Your solution works just great! Now the background is updating as the Java dialog is moved over the screen! The key here was to configure the DLL call as re-entrant while setting my subVI wrapper as non-reentrant.

Thanks again!!

/Mikael

0 Kudos
Message 6 of 7
(3,370 Views)
Nice to hear 🙂
--
Tomi Maila
0 Kudos
Message 7 of 7
(3,363 Views)