LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL created by labview get stuck

I tried to run test created with lab view with external tool.
This tool load dll and call execution function.
I created a dll from the Labview test (I used simple function for test that only extract numbers) and I used __stdcall
when I use this dll from an executable It works fine. (My application call a dll, and the dll call to the dll created from labview)
however when I use it from my dll it get stuck
I tried to load the dll dynamically with loadLibrary() and It works fine only for the first time (It gets stuck when I called it again)
I found that if I call it from the same thread it works fine, but if I call it from two different threads (the second call is long after the first call has finished, so there is no race condition) It gets stuck from the second thread.
I used visual studio to see where the call get stuck, and it is in lvrt.dll 
 
Does anyone know what can I do to solve this problem.
0 Kudos
Message 1 of 2
(2,441 Views)
Although the writeup is about .NET, the issue is the same, so check out http://detritus.blogs.com/lycangeek/2005/05/labview_and_asp.html
 
The problem might be that the first thread is not pumping messages and so the LabVIEW gets hung up waiting for events. This problem has been fixed in LV 8 so I'm assuming you're using an earlier version. If so, you can follow the steps outlined in the link above (creating a message pumping thread and calling your DLL with that first).
0 Kudos
Message 2 of 2
(2,430 Views)