LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Community Nugget 4/08/2007 Action Engines

Solved!
Go to solution
Here is an example of an AE with "memory management".  I threw it together with minimal testing, but it should work as a simple example.


Message Edited by DFGray on 04-13-2007 08:39 AM

Message 41 of 161
(8,381 Views)
Nice job Ben!  Certainly very thorough 🙂

@Ben wrote:

*LabVIEW Programming Techniques" produced by Viewpoint Systems Version 2.2 August, 2000 page 67. I believe this book was the precursor to the original version of NI’s "Advanced Applications Development Course"



Actually, the Advanced Application Development Course was originally written and taught by VI Engineering, Inc, and formed part of our VISTA Program.  The course was later sold to NI.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
Message 42 of 161
(8,366 Views)
Chris wrote;
 
"

Actually, the Advanced Application Development Course was originally written and taught by VI Engineering, Inc, and formed part of our VISTA Program.  The course was later sold to NI.
 
"
 
 I stand corrected! Smiley Happy
 
Thank you for setting the record straight. I knew one of those books I read was the basis of the advanced course. Smiley Wink
 
Ben

Message Edited by Ben on 04-14-2007 01:17 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 43 of 161
(8,362 Views)


@Matthew Williams wrote:
To follow up on DFGray's comments, I usually keep a pointer (in the AE) to the next available location in the AE array.
When the pointer = array size, time to go get more array elements.  If you allocate in 100 entry chunks your memory
manager overhead is decreased by ~99%, with modest over-allocation.  Works very well for typical AE array sizes we
work with, hundreds to low tens-of-thousands elements.

Matt


My approach for such adaptive memory management is usually to start with a certain value (100 is quite a good one) and then
when I run out of memory I always double the array size. This has IMO provided about the best performance without sacrificing to much memory.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
Message 44 of 161
(8,345 Views)
Thanks Rolf.  There is definitely a trade-off between over allocation and speed, and
we have used both approaches.  Doubling is probably the lowest overhead approach
when you can't preallocate.  We have applications, however, where the potential
over allocation worries me.  The first n doubles are never a problem; it is always that
n+1 double that crashes the memory manager (or makes it go virtual) and leaves
you with a 49% unused array.  Both techniques work, and, fortunately, each application
is unique so we all get to remain employed 🙂

Thanks.

Matt
Message 45 of 161
(8,346 Views)

@Ben wrote:
"Actually, the Advanced Application Development Course was originally written and taught by VI Engineering, Inc, and formed part of our VISTA Program.  The course was later sold to NI. "
 
I stand corrected! Smiley Happy  Thank you for setting the record straight. I knew one of those books I read was the basis of the advanced course. Smiley Wink


No worries Ben - we're actually quite proud of the old course as it departed from some of the traditional topics covered by NI's internal courses and branched out into some real advanced concepts.  Apparently (I've been out of the training side of things for a while, so my Certified Professional Instructor certificate is going a little yellow on my wall 🙂 ) the course has changed quite a lot since we handed it over.  I'm looking forward to helping shape future LabVIEW training, both internally and externally.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
Message 46 of 161
(8,340 Views)
Great article, Ben.  Kudos and thanks! 🙂

-Jim

Message 47 of 161
(8,332 Views)

You are very welcome Jim!

Thanks you to all of the readers and contributors of this Nugget.

It was fun and I learned some stuff along the way.

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 48 of 161
(8,304 Views)

Very good post Ben.

Sorry to take so long to congratulate you..  I was digesting all this concept.  Very nice indeed!

RayR

Message 49 of 161
(8,283 Views)
Here's a link to another action engine example I posted a while back and which demonstrates using them to handle UI updates.

___________________
Try to take over the world!
Message 50 of 161
(8,180 Views)