Why does this sample vi use so much memory? 
Author Message
 Why does this sample vi use so much memory?

The default values?

Ben



Tue, 06 Dec 2005 03:55:36 GMT  
 Why does this sample vi use so much memory?
Sorry - I don't understand your answer.


Tue, 06 Dec 2005 04:10:14 GMT  
 Why does this sample vi use so much memory?
Hidden behind the scenes is a copy of the default value of the
control.

When you do a "save as default" there is a copy made of the data.

Ben



Tue, 06 Dec 2005 20:22:06 GMT  
 Why does this sample vi use so much memory?
mlayton,

Avoiding large arrays being copied is an art in labview. This time the
LabVIEW compiler is too smart trying to optimize the code. When you
use "Initialize Array" with all constants on input, LabVIEW creates
the array at compile time and saves a copy of the initialized array.
When copied to the indicator, that makes two copies.

To prevent one copy, replace one of the constants (8,7 or 4320) with a
FP control with the same default value. Then the array will be created
at run-time only.

Do not display the array in an indicator if you can avoid it as
LabVIEW makes a copy for the indicator display. The user doesn't need
to see the 967,680 values. If you need an indicator to pass the array
to its caller, LabVIEW will manage to reuse the array space if the
subVI always keeps its FP closed (no need for display).

If the large array is to be used everywhere in the application, it can
be stored in the shift register of a subVI. In this subVI, put all the
code required to manipulate the array (Initialize/Read/Write/
elements, etc). That will greatly reduced te number of unnecessary
copies of the array.



Tue, 06 Dec 2005 21:07:46 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error 10800 using continuous scan vi limiting sample size to 512

2. Using control reference with a Sub-vi over a TCP VI Server connection

3. Using control reference with a Sub-vi over a TCP VI Server connection

4. Can I open a VI using another VI

5. Using VI Server to pass data between a Labview Executable and a VI

6. Why does the "Dispose Report.vi" doesn't release memory used by report

7. why why why oh why why baby

8. Why is SetKey doing something different?

9. Why Forth is not doing so well

10. functions -- what is Verilog doing here and why?

11. Why was this done?

12. Why is the DOE selling AdaSage ????

 

 
Powered by phpBB® Forum Software