09-13-2014 02:14 PM
Hi
I recently came across an example where the developer had used a data value reference for the class cluster in LabVIEW.
What are the advantages of doing this?
Doesn't the use of LV objects already avoid the creation of multiple copies of data thereby reducting memory usage?
Thanks
AD
09-13-2014 11:57 PM
A class wire acts just like any other wire:
As the image shows, once the wire is split, you can have two separate copies, each with its own data. If you want to explicitly have one shared block of data, you can use a DVR, either to hold the object, or inside the object to hold a cluster, and then the thing that's copied is the DVR itself and not the data inside it.
09-14-2014 01:49 PM
LabVIEW's OOP is implemented as a By Value. This means, as Tst stated, branches in wires could mean copies in the object. The DVR is a way to make it By Reference.