LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Library Function Node memory limit?

I am using labview 7.1 and a third party .DLL driver. The data structrue in the driver contains an array of structure and it is called using the 'Call library function node'.

 

When the size of the array is 65000, the VI runs fine. However when it is 66000, the VI reports an error saying memory is corrapted. My question is: Is there a limit for the memory assigned to the call library function node? If yes, how to enlarge it?

 

I have no problem calling the .DLL in C and Matlab.

 

 

0 Kudos
Message 1 of 5
(2,587 Views)

I bet you the problem starts at 65536 (it should work fine through 65535).

 

Two possibilities:

1) In the DLL, the array size is a 16-bit number.  If that's the case, it's kind of difficult.

2) In your labview VI, you are somehow using a 16-bit integer when you should be using a 32-bit integer.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




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

Thanks. That is a very wise guess. But it actually has problem when size = 65213 and fine when size = 65212. The parameter I fed to call library function node is a I32 type.

 

I wonder why that is not a problem for C or matlab?

 

 

0 Kudos
Message 3 of 5
(2,561 Views)

Hey bo,

 

Memory corruption is not extremely uncommon when dealing with arrays being passed to a call library function node. Normally, you will see the memory corruption when you close LabVIEW, but sometimes you will see it immediately. But when LabVIEW is performing its garbage collection, it will eventually run into the corruption and crash.

 

The two main causes of memory corruption are passing an uninitialized string or array and writing beyond the bounds of the string or array in the DLL function.

 

I would just verify all of your parameters are as expected, and initialize your array.

 

Hope this helps!

Chris Van Horn
Applications Engineer
0 Kudos
Message 4 of 5
(2,557 Views)

bo200008 wrote:

Thanks. That is a very wise guess. But it actually has problem when size = 65213 and fine when size = 65212. The parameter I fed to call library function node is a I32 type.

 

I wonder why that is not a problem for C or matlab?

 

 


Without seeing the VI and at least the DLL header file and hopefully some background about the DLL it is basically impossible to give you more a conclusive answer than what you got so far.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(2,539 Views)