09-17-2015 10:47 AM
Dear all,
Does it exist a method such has IMAQ Dispose for arrays?
I have a VI which receives several big 2D arrays (interface requirement). These are converted into IMAQ images and processed. In the last step of th VI resulting Images are again converted and returned as 2D arrays.
I would like to dispose the input arrays once they have been converted into images and thus liberate memory usage. Is there a way to do this pragmatically?
Best regards,
Esteban
09-17-2015 10:50 AM - edited 09-17-2015 10:52 AM
If you're just trying to clear your inputs, you can write to them using local variables... You don't usually need to do this though, so what's your reason? Once the data is passed through the inputs, clearing the arrays doesn't clear up memory.
Maybe what you really want is to inline your subVI. This removes all memory associated with the inputs and outputs. Check out the SubVI Overhead section here.
You should share the VI, so that we can better understand what you need.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-17-2015 10:58 AM
Hey James,
For confidentiality reasons I can´t share the code here.
The full code is a chain of sub VIs. Every subVI receives 2D arrays and returns 2D arrays. Inside every subVI the arrays are converted into IMAQ images for processing.
The chain causes the arrays to be copied many times, and it consumes a lot of memory.
The requirements of the program is that every subVI have such interfaces.
I am wondering how to decrease the memory consumption. I guess disposing the input arrays after they are converted to images could help.
Best regards,
Esteban
09-17-2015 11:02 AM
Why must the arrays be displayed with each subVI? This functionality is going to require that the memory space is used. Are they each popups every time they are run?
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-17-2015 11:02 AM
Can you post a stripped down version of your code?
Is there a reason you have to convert from an array to an image in every subVI?
09-17-2015 11:16 AM
Dear all,
I have created a little example.
Imagine the chain of my SubVIs (called from a VI) are like the one shown in attachments.
The arrays are converted to IMAQ images to use the methods of the Vision tool box.
Hope the example helps to clarify the problem.
PS: I´m not pretty sure how to dispose the images.
regards,
Esteban
09-17-2015 11:21 AM
I cannot open your code (using LabVIEW 2014). Could you post a snippet or convert to 2014?
09-17-2015 11:22 AM
Someone else I'm sure has 2015 on here who can help, but I'm still back in 2014.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-17-2015 11:31 AM
Please try with this.
09-17-2015 11:38 AM
Ok, it looks like you will want to destroy the images after you convert that image to an array, otherwise you don't know if the image will be destroyed before conversion or not. Also, you can use the error wires (along with others) to make sure your VIs execute in the desired order, the sequence structure is not necessary.