LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

where to put data referenced via a global DVR

I have a large complicated cluster, and a very large array, that are accessed by nearly every VI/SubVI in my project. I do NOT want to wire them in and out of each routine; I'd prefer them to be globals.

 

I can avoid copying the data every time it's accessed in a SubVI by creating a Data Value Reference (DVR) for each. I can make the DVRs global; each SubVI that requires access to the cluster or array can use the global DVR to access the data, wiring the global DVR to an an in-place element.

 

Here's my question: Does it matter where the data itself (the cluster and the array) exist? My instinct would be to place them in the top-level main VI, which also creates the DVRs (and destroys them prior to exit). But the cluster and array could be globals themself. Is there any reason or benefit to doing that (make them globals as well as the DVRs that point to them)?

 

(A note: netiher of the data structures I'm discussing appear on the user interface...)

 

Thanks guys....

0 Kudos
Message 1 of 3
(2,260 Views)

You don't put the data anywhere.  They are contained in the DVR.  The only issue would be when you actually create the DVR.


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
0 Kudos
Message 2 of 3
(2,249 Views)

But the cluster and array could be globals themself. Is there any reason or benefit to doing that

 

Not that I can see.  a DVR to a Global would still require you to read the global to operate on the data.  Poof! that just forced a data copy.  exactly what you tried to prevent by creating the DVR to pass around.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 3
(2,238 Views)