LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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
(338 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.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 2 of 6
(335 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
(332 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).


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 4 of 6
(322 Views)

Thanks. That makes sense!

0 Kudos
Message 5 of 6
(315 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
Averna BV
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
0 Kudos
Message 6 of 6
(308 Views)