LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
jpi@zodiac

direct access to a data structur of a Global or Local Variable

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

It would nice if it is possible to access values of a Data strcture via indexing in a Unbundle node.

 

For example this Data structur:

 

data.png

 

 

Conventionally practice to access value in array field no 5:

 

old_access.png

 

My idea to access this value:

 

new_access.png

 

Pleas vote for my idea... Thank You.

 

 

6 Comments
Intaris
Proven Zealot

Hmm.  This would still require a full copy of the data in order to write the data back to the global otherwise the data could become invalid while you're operating on the data (Another process writes an array with size 3 to Data.Values).  Global writes are atomic AFAIK.

 

For reading, it should be possible and I think it's a good idea.  I would be careful though in trying to allow something which the compiler may already optimise out of the code....

jpi@zodiac
Member

Here an example wat it do at a write operation:

 

write.png

Intaris
Proven Zealot

I would tend to think that if you want this kind of access, use DVRs instead of globals.  Then you can use the IPE to get at the inner workings and you don't have to worry about data copies.

AristosQueue (NI)
NI Employee (retired)

> Global writes are atomic AFAIK.

 

They're atomic on simple data types. For compound types, they're mutex protected because those can't be copied in a single operation. This is on both reads and writes.

 

If we were reading internal data (meaning the nested data that the idea is asking for), we would always use the mutex.

Intaris
Proven Zealot

Nice to know. Thanks AQ.

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.