LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Crash course in Event Structures


Ben wrote:
he learned that explicitly opening a reference always allocated some memory

This is exactly my concern...  I didn't write that in my last reply because I didn't want to appear foolish.

So is my concern a valid one?  Does it matter in today's world of ever growing memory (and sloppy use thereof)?

Is this a good practice?  Or should it be avoided?

 

R

0 Kudos
Message 31 of 34
(484 Views)

Ray.R wrote:

Ben wrote:
he learned that explicitly opening a reference always allocated some memory

This is exactly my concern...  I didn't write that in my last reply because I didn't want to appear foolish.

So is my concern a valid one?  Does it matter in today's world of ever growing memory (and sloppy use thereof)?

Is this a good practice?  Or should it be avoided?

 

R


I advise to avoid it. If your app runs 24 X 7 it is only a matter of time before it will run out of memory.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 32 of 34
(469 Views)

The key to making a cache of references work is to make it exactly that - a look-up table which does not change.  It should be set up during initialization and then never needs to be written to again, nor do the references need to be opened again.  Yes, caching references does use memory, but if you only have one copy of each reference, it is not that significant.  I usually use a shift register wire for this but am playing with using a referenced LabVOOP object.  See the next installment of the Xylophone Project, number X, for details.  I should have it out in a week or two (life has been busy lately Smiley Tongue ).

 

I always close references when I am finished with them, but LabVIEW will clean up references when the VI which opened them leaves memory.  Be careful with this.  If you have a dynamically called VI which creates references, do not cache these references or they will go bad when the dynamically called VI exits memory.

Message Edited by DFGray on 05-20-2009 08:49 AM
0 Kudos
Message 33 of 34
(458 Views)

Thanks  🙂

 

Very good comments.  When I created a cluster of references, it was only done once, during initialization (actually..  the verfy first step prior to initialization).  It was for a dynamic Operator Interface.  It worked very well.  I wasn't sure if it was an acceptable practice, so I came up with an alternative implementation solutions since then.  However, the cluster of references was then wired to shift registers and extracted/read asneeded.

 

I would never use dynamic VI's to create references for the obvious reasons.

 

Thanks for the info.  I may actually evolve the present solution again.  😉

 

RayR

0 Kudos
Message 34 of 34
(443 Views)