luc desruelle's Blogue

Navigateur communautaire
annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Quand faut-il fermer une référence sous LabVIEW?

Desruelle_luc
Trusted Enthusiast

Pour faire simple, il n'est besoin de fermer que les références "créés" programmatiquement, et pas par "clic droit"

http://www.ni.com/white-paper/5320/en/

http://www.ni.com/white-paper/14393/en/ 

 

The standard method of referencing objects is to open a reference to the object, use the object, and close the reference to the object. Whether you close a control reference depends on how you generated it-with a control reference constant, a Property Node, or the Event structure 

 

When you open a reference to an application, project, VI, or other reference source, LabVIEW allocates memory to store that reference. To free up the space in memory where LabVIEW stored the reference source, you must close the reference. It is always safe to close a reference when you no longer need it. You can use the Close Reference function (linked below) to close a reference.  

 

Exceptions : Implicit References and Unwired Property and Invoke Nodes  Although you should usually close references when you no longer need them, you can leave implicit references and references returned in the reference out terminal of unwired property and invoke nodes open, shown below, because a Close Reference function does not actually close these references or remove the target objects from memory.   

 

If you do not close a reference, your application is susceptible to reference leaks that can use up memory and slow the execution time of the application. LabVIEW automatically closes a reference when the top-level VI that opened the reference goes idle, but if the application runs for extended periods of time, the effects of reference leaks gradually increase.

 

Quelques exemples de référence à ne pas fermer

ref2.png

 

De même (le close n'est pas utile)

 

ref.png

banniere Luc Livre NXG Champion.png

Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion

MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group