08-19-2009 11:02 AM
Hi,
this thread is based on my post in the LabVIEW idea exchange.
I put my VIs in the attached .rar file.
Regards
Marc
Solved! Go to Solution.
08-19-2009 11:10 AM - edited 08-19-2009 11:11 AM
I still don't see your problems with the code.
Here's the output of MY running of the code.
Shane
PS Make sure the sub-vi is not open (even if the FP is not shown) when running the program
08-19-2009 11:16 AM
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
08-20-2009 12:48 AM
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
08-20-2009 01:48 AM
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.
08-20-2009 03:06 AM
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
08-20-2009 03:21 AM - edited 08-20-2009 03:23 AM
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.
08-20-2009 07:48 AM
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