LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW crashes when function called from DLL

Hello,
 
I'm a relative new user of LabVIEW and looking for some help. I've posted this issue in another board and was unsuccessful. I was told to try it here.
 
LabVIEW crashes everytime I run it. The code (error.vi) contains a subvi (error2.vi) which calls a function and crashes. The information about the dll file can be found at the following site http://www.amptek.com/mcadll.zip  . Hope you can help
Download All
0 Kudos
Message 1 of 5
(2,960 Views)

Hi DCm,

      I can't open your VIs because I'm using LV7.1 - but if you describe which DLL function you're calling, I may be able to help! (I downloaded the DLL .zip including .pdf.)

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 5
(2,946 Views)
Thanks for your response,
 
The particular VI in the previous email used the "Pmca Async Power up" function. Every function with the "Async" seems to crash in labVIEW. The other non-Async functions work without a problem. However, the "Async functions" are recommendated for creating user interfaces.
 
Thanks.
0 Kudos
Message 3 of 5
(2,937 Views)
From the programmers guide in the zip file:


Asynchronous functions have an additional parameter, a pointer to the field that will receive the result of
the operation on the function completion.


This makes me think that you shouldn't call the Async functions from labview.

I recommend using the Synchronous functions, and setting the Call Librarty Function node to "Reenterant" instead of "Run in UI Thread".  That way labview will still be able to do other things while the DLL function is executing.

Unfortunately, this also means that labview might try to call two functions from the DLL at the same time, and that could be bad.  To get around this, you could either use semaphores or put all of your calls to the DLL in the same VI.

Adam
0 Kudos
Message 4 of 5
(2,930 Views)

Adam,

 

I'm shown that problem to another NI engineer and he was stuck too. However, call the librar ynode to "reenterant" actually allowed the code to run better. Thanks for your help.

 

 

0 Kudos
Message 5 of 5
(2,908 Views)