03-15-2023 07:00 AM
Hello, I'm working on a project that i m going to build into a DLL and use it later on a CVI Program.
In my labview VI I'm using a massive array of uint8 (sized, 10000000 byte) saved into memory and i m calling it via its reference, and it works fine in labview and in my CVI test program.
I have two questions :
1) when i m done using the dll in my C sequence (I mean the program is testing the products in a loop and each time it calls the functions of the dll), does the memory allocated for the array, free up automatically, or do I need to manually clear it ?
If so, how can I do that using only the reference.(in LabVIEW or in CVI) ?
The array saves an image.
Solved! Go to Solution.
03-15-2023 07:06 AM
Hi hmdfr,
@hmdfr97 wrote:
In my labview VI I'm using a massive array of uint8 (sized, 10000000 byte) saved into memory and i m calling it via its reference
1) when i m done using the dll in my C sequence (I mean the program is testing the products in a loop and each time it calls the functions of the dll), does the memory allocated for the array, free up automatically, or do I need to manually clear it ?
2) If so, how can I do that using only the reference.(in LabVIEW or in CVI) ?
Set the value of that array to "empty array" to free the momory…
03-15-2023 09:22 AM
Thank you for your reply.
Yes, I used a fontanel element to hold it, then I created a reference to that element and built the dll.
In my application, I was declaring the entire array each time I access the module containing the dll (a turntable of a tester with a labwindows sequence) I have no idea if it is cleared or not but the application crashes often, so I decided to use a reference instead and start looking (i m just getting started with labview by the way). I run a test now to see if the memory increases and I found out after I pass by the station containing the sequence, the memory adds up a bit.
But now setting the array to a default value using an invoke node worked just fine.
This all is because I'm using an IMAQ image and I want to pass it between functions without using a global variable or the data itself. When I build a dll it gives me an uintptr_t that I can't use, so I converted it to an array but if there is any other solution I am all ears.
Thanks again @GerdW