LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application built with NI LabVIEW 64 containing dll crashes

1. I am generating deep learning DLL from MATLAB. DLLs are running fine in LabVIEW project. When I tried to build application of the VI containing DLL, the application starts crashing. I added the DLL in "Always included" option of source files while building application. 

This problem is specific to deep learning DLLs, when i built a simple a+b DLL in MATLAB and built its application in LabVIEW, it is working fine.

2. Another issue is that sometimes when calling deep learning DLL, LabVIEW itself starts crashing. Restarting or changing the LV folder solves it. 

    

 

0 Kudos
Message 1 of 2
(818 Views)

Such errors can basically mean two things only. An actual bug in the DLL itself (not so likely here as it is Matlab generated DLL but never totally impossible) or an error in how you configured the Call Library Node to call one or more of these functions.

 

The fact that it doesn’t always crash is not relevant here! Somewhere you do incorrectly pass a buffer to the DLL that the DLL then tries to write into and either the datatype of that buffer doesn’t match what the DLl function expects or the bounds you provide are incorrect, causing the function to write beyond the valid area of that buffer and corrupting memory used for other things.

 

The only valid course of action is to go and review every single Call Library Node and make sure the configuration matches the actual function prototype exactly. Also if you pass in arrays or matrices to functions that the function is supposed to write into you have to create (allocate) them first with helper functions that Matlab created for you and added to your DLL. And any such buffer needs to be deallocated by a corresponding helper function afterwards.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 2
(790 Views)