From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Library Property node need to be "cleared"??

Hello,

 

I am using the "Call Library Property Node" in a VI to do some calculations (the calculation is done by Fortran source code which compiled as dll). Everything seems working ok except for one issue.

 

In my code I have an array of input with certain length, say 6 elements. I expect to get the same number of elements output from the calculation dll, which did happen the first time I run the code. Now if I increse the element of input to 8, I get 8 outputs, with no problem. However, if I now DECREASE the element of input back to 6, I still have 8 outputs displayed in the indicator! The last 2 elements actually from the previous calculation with 8 inputs. If I close the program and then reopen it, it back to normal.

 

Why those values are still there? It seems they are left over in somewhere.  I am not sure if this is something to do with close reference? But I do not know what to close and how to close. Or do I need to clear something?

 

Any suggestiong would be greatly appreciated! Thanks

 

Rgds,

 

Harry

 

0 Kudos
Message 1 of 6
(2,250 Views)

I think it's LabVIEW trying to save memory allocations and reusing the array.  I would just use the the Array Size on your input array and use Array Subset to trim the array to the same size as the input.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(2,247 Views)

Crossrulz,

 

Thanks for your reply. What you suggested is actually what I am doing it right now as a "bandage". I had memory leak problem in the past so I always try to avoid any potential issues (this code normally need to run months without interrupt at industrial site). I just want to make sure when calling the dll in loop (excutes every second), this issue won't casue any major problem.

 

Do you think there is any better solution to avoid this from happening? Thanks again!

 

Rgds

 

Harry

0 Kudos
Message 3 of 6
(2,244 Views)

Not that I know of.  But having LabVIEW reuse the memory is actually in your favor (it's not constantly reallocating memory, reducing your leaks).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6
(2,234 Views)

Thanks. That makes sense!

0 Kudos
Message 5 of 6
(2,227 Views)

How do you decrease the input array? A little example VI posted with your original inquiry would make such questions unneccessary! Words can describe a graphical program only in a limited way, especially if it is not your native language, and even a screen shot leaves out about 70% of possible informations.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(2,220 Views)