LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are there any advantages to using a Data Value Reference for LabVIEW Classes?

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

0 Kudos
Message 1 of 3
(3,401 Views)

A class wire acts just like any other wire:

 

Copies.png

 

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.

 

 

 


___________________
Try to take over the world!
Message 2 of 3
(3,363 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(3,322 Views)