LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory usage of big Array in sub-VI (was: Allow the creation of "Inplace"-VIs of Idea Exchange)

Solved!
Go to solution

Hi,

 

this thread is based on my post in the LabVIEW idea exchange.

 

I put my VIs in the attached .rar file.

 

Regards

Marc

 


 

CLD
0 Kudos
Message 1 of 8
(3,762 Views)

I still don't see your problems with the code.

 

Here's the output of MY running of the code.

 

inline VI.PNG

 

 

Shane

 

PS Make sure the sub-vi is not open (even if the FP is not shown) when running the program

Message Edited by Intaris on 08-19-2009 11:11 AM
0 Kudos
Message 2 of 8
(3,759 Views)

A VI CAN re-use the buffer of teh calling Vi under the proper conditions. See teh "Clear as Mud" thread where Greg McKaskle lifts the hood and tells us what we are looking at.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 8
(3,750 Views)

Intaris wrote:

I still don't see your problems with the code.

[...]

PS Make sure the sub-vi is not open (even if the FP is not shown) when running the program


Hmm, I get without opened Sub-VI "delta t 1: Step into Sub-VI=60ms" (I still cannot upload images, therefore see attachment).

 

I will check the thread Ben mentioned and see, if I missed some optimization.

 

Regards,

Marc

CLD
0 Kudos
Message 4 of 8
(3,720 Views)

Wierd.

 

I'm using your VIs, unchanged except for an obligatory re-compile in LV 2009.

 

What version LV are you using?

 

Do you have any tools which monitor VIs which are loaded which may be responsible for loading the FP into memory even though it's not visible?

 

Shane.

0 Kudos
Message 5 of 8
(3,712 Views)
Solution
Accepted by topic author Marc Blumentritt

I just tried in LV 8.5.1. I see a delay like Marc. I think the problem has to do with constant folding. When I change the constant in "initialize array" to a control it can't fold it, and then "delta t 1" becomes 0. This is usually closer to reality anyway.

It looks like LV has to copy the constant folded array (in LV 8.5) when it is passed to a SubVI.

 

Daniel

 

Message 6 of 8
(3,699 Views)

That would be a good explanation.  There was a thread on something very similar to this recently.  Can't remember exactly the topic but Daniel's answer certainly triggered some memories of a very similar discussion taking place.

 

I think it had to do with LV assigning a Array created as a constant as Read-only so in order to make changes to it it needs to be copied to a new memory location, thus leaving the constant unchanged.

 

I wonder how it performs in other LV versions.

 

Shane.

 

PS: Found the thread.  HERE.

Message Edited by Intaris on 08-20-2009 03:23 AM
0 Kudos
Message 7 of 8
(3,695 Views)

dan_u wrote:

It looks like LV has to copy the constant folded array (in LV 8.5) when it is passed to a SubVI.

 

Daniel

 


You got it, Daniel! I have the same results.

 

And if you want to remove the extra and unnecessary control, you can use "random number" instead, since it cannot be "constant folded".

 

Big thanks for solving this mystery.

 

Marc

CLD
0 Kudos
Message 8 of 8
(3,675 Views)