LV2013, Win7
I'm new to Data Value References and trying to figure them out.
In the previous episode, I learned that if you use the wire that you feed to MAKE DVR somewhere else, LV will perform a COPY of whatever you feed it, and the reference refers to that copy.
That makes sense when you consider that you can MAKE DVR from a constant 5.0.
If you were to use the DVR to manipulate the value, and loop over that again, the constant 5.0 would not be 5.0 anymore, and that's just stopped. So I get it.
To access the data the DVR refers to, you have to use an INPLACE ELEMENT structure.
That performs a MUTEX operation to access the data in one place and one place only, I get it.
HOWEVER, take a look at this diagram.
The thing I want to share (via DVR) is a cluster containing an array of Sequence Elements (never mind) and a few other things.
In this code, I want to get an index for one element of that array, and extract a copy of it to display.
I have SHOW BUFFER ALLOCATIONS turned on.
I understand why I have an allocation at point #1 - I want to make a copy, and that's fine.
What I DON'T understand is why there is an allocation at #2 or #3.
The bottom is an alternate method to see if anything changed - it didn't.
If an INPLACE element has the purpose of preventing (or trying to prevent) the copying of data, and the DVR's purpose is to refer to a single instance of the data, then why is there a buffer allocation here (#2)?
It looks to me like it's making a copy of the whole structure, and then extracting a single element? Am I understanding that right?
What is a better way to copy a single element from an array via DVR?