LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone explain me about DATA VALUE REFERENCE ... for what it is exactly used ??

Solved!
Go to solution

I want to know about DATA VALUE REFERENCES in LabVIEW .. where it is mainly used.

Help me out if you can

0 Kudos
Message 1 of 14
(4,689 Views)

@Ramprakash0111 wrote:

I want to know about DATA VALUE REFERENCES in LabVIEW .. where it is mainly used.

Help me out if you can


In short; When you want to make sure you work on the same data on several places and/or when you want to isolate a small data set from a big cluster.

As you probably knows, splitting a wire will create a data copy, this can sometimes create issues. A DVR is basically used the same way as a reference in other languages. 

When using clusters you get data copies when using Unbundle, which can affect performance if the internal data is big, with DVRs you can 'aim' for the correct data and avoid this. I posted a solution long ago where someone had a cluster of a couple of single values and a big array and reading the single values was slow. This proved to be due to the big array being copied as part of the read, so by using DVR the performance increased a lot.

In G#, e.g. we use it to get reference based classes instead of getting class copies whenever a wire is split.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 14
(4,638 Views)

Can you please share me any documents or codes related to Data Value Reference [DVR]..

Thank you in advance !!!

0 Kudos
Message 3 of 14
(4,573 Views)

Note that in other languages (C\C++), using a reference causes new problems when multithreading (A-Synchronous data access). You'd need to somehow prevent race conditions between threads accessing the referenced object.

 

LabVIEW DVRs solve this, by only allowing access to the data in a In Place Element Structure.

 

One of the biggest downsides of DVRs is that they are not persistent. The moment the hierarchy the DVR was created in stops running, the DVR is released. This often that means after stopping the main VI, the subVIs can't be debugged anymore, as the DVR data is gone.

Message 5 of 14
(4,540 Views)

A Look At Race Conditions.  I should also note that, with the advice of a fellow Champion, I redid the linked benchmarks using a large array and the DVRs became a lot more performant than the other alternatives.  So I find DVRs best used for large data structures that you need to access and/or modify from multiple loops.

 

The other place I used DVRs was for a modular power supply driver where multiple classes (the power supply modules) needed access to the mainframe class (commands had to go through the mainframe).  So this goes along with the By-Reference OOP mentioned earlier.



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 6 of 14
(4,531 Views)

Thank you so much for your time and help ... kudos !!



 

0 Kudos
Message 7 of 14
(4,527 Views)

Thank you very much for your help ! will be so happy if u can share any examples vis based on DVRs ..Thank you in advance !!! kudos !!

0 Kudos
Message 8 of 14
(4,523 Views)

Thank  you very much for your help.. pls share any vis you have , based on DVR concept .. Thank you

0 Kudos
Message 9 of 14
(4,521 Views)

Can anyone send me the code for solving this using DVR.. i am currenly working in DVR and this will help me in knowing where to use it. Thank you in advance !!

0 Kudos
Message 10 of 14
(4,501 Views)