LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Error in Call Library Function Node calling a LabVIEW DLL

Solved!
Go to solution

Hi,
I have a simple code that calls "IMAQ Straight Edge 3" VI. The code runs fine when it is a VI. But my requirement is to build it as a DLL, later to be called from a C code. As a practice I try to call the DLL using CLFN to check if the DLL is built properly and working before writing the C code. 

 

The following sample code contains a VI(imaqwrapper.vi) that simply wraps the IMAQ Straight Edge 3 VI(although I will add more code later). This VI is built as a DLL and called using CLFN. When the DLL function is called in caller.vi, memory error pops and LabVIEW crashes completely. (memory manager error 0x0037c03d at line 1425)

I doubt the StraightEdges array. But, since I'm passing an empty LabVIEW array handle, my expectation is that LabVIEW resizes this array as and when required without any issues. 

Is there anything wrong in this code? 

Thanks.

0 Kudos
Message 1 of 2
(842 Views)
Solution
Accepted by topic author samkm

So, I found the issue in Call Library Configuration. StraightEdges must be configured as "Adapt to type" and "Pointers to Handles"(triple pointer) instead of "Handles by value"(double pointer to array base). This fixes the error.

0 Kudos
Message 2 of 2
(786 Views)