LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Value Reference - Is there any value to this methodology?

Please take a look at the photo. Yes, this is a garbage VI.  I'm just trying to make something that sums up what the end game Framework would look like.  Is there any value to making Data Value References out of References and then passing those onto asynch VIs where they can be accessed as seen?  There just seems something redundant about it.

DailyDose_0-1654813718435.png

 

 

0 Kudos
Message 1 of 15
(2,974 Views)

Not much value. You use Data Value Reference to pass large datasets without creating duplicates and to work on the original data source.

 

Since the control reference is a "reference" with no value, creating a reference to a bunch of references does not provide any advantage.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 15
(2,964 Views)

Maybe something like this would be better.

snip.png

Message 3 of 15
(2,954 Views)

@mcduff wrote:

Maybe something like this would be better.

snip.png


So really, this methodology only useful for indicators and not controls. Just use regular references for controls? But then, the methodology in your VI, there's an ongoing loop that just reads data? Are notifiers required to avoid any race conditions?

0 Kudos
Message 4 of 15
(2,931 Views)

@DailyDose wrote:

@mcduff wrote:

Maybe something like this would be better.

snip.png


So really, this methodology only useful for indicators and not controls. Just use regular references for controls? But then, the methodology in your VI, there's an ongoing loop that just reads data? Are notifiers required to avoid any race conditions?


No race conditions with DVR, like a FGV, do not support concurrent write/read access.

Only recently has parallel read access been added.

I know your example isn’t a real application, but what are you trying to do? You want to update a control from an asynchronous process? You could always read the DVR and update a local variable for your control.

Message 5 of 15
(2,914 Views)

Here are a couple of screenshots for my DVR use cases:

Full Dataset is decimated and then scaled and put into a "PlotDVR". Using the the DVR allows me to send a reference to other loops rather than the full dataset.Full Dataset is decimated and then scaled and put into a "PlotDVR". Using the the DVR allows me to send a reference to other loops rather than the full dataset.After the data is decimated, a message is sent to another loop to read the DVR for display purposes.After the data is decimated, a message is sent to another loop to read the DVR for display purposes.

Message 6 of 15
(2,910 Views)

@mcduff wrote:

I know your example isn’t a real application, but what are you trying to do? You want to update a control from an asynchronous process? You could always read the DVR and update a local variable for your control.


In one of my applications I was updating an indicator and a control.  I guess I'm trying to figure out what exactly is the value/benefit of Data Value References over regular references if I'm having to create additional loops that will read it back in order to update the Front Panel.  

0 Kudos
Message 7 of 15
(2,885 Views)

In the Object Oriented realm, could you make a DVR of the object and pass that around to all the Asynch VIs?  I guess I could see some value in that.

0 Kudos
Message 8 of 15
(2,880 Views)
Message 9 of 15
(2,867 Views)

A reference to a reference is never necessary. You are simply adding a second layer to access the data. If you are simply trying to interact with front panel controls and indicators then all you need is the reference to the desired controls or indicators.

 

Now for a more philosophical perspective, unless the subVIs or asynchronous tasks are strictly for working with the UI you should never pass references around that your lower level code uses to update to the UI.  All this does is create coupling between your code which makes reuse much more difficult. For example, some lower level code processes some data via some algorithm or transformation. The code doing this should ONLY do that. It should have no concept nor should it care with how that resulting data will be used. If it also updates some control or indicators on the UI than this code is forever locked to a UI with that same control or indicator. If this same code were used and rather than display the data you wanted to simply log it somehow it would be difficult to reuse the code. You would have to create dummy controls/indicators so you could pass them into the subVI.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 10 of 15
(2,856 Views)