From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
EricC.

In place struct with read only item

Status: New

When you use the sturcure element in place, there are often clusters with parameters and work values.
The parameters used may have to update the values.

Currently, the code is quite complex and quickly becomes difficult to read if the cluster is Comlex.

A solution is to have the possibility to use "read only" item from a cluser.

inplace - actual.png

inplace - proposition.png

Ingénieur d'Application / Développeur LabVIEW Certifié (CLD)
Application Engineer / LabVIEW Certified Developer (CLD)
5 Comments
Intaris
Proven Zealot

I don't really see the big difference between the proposed solution and your actual solution 1.

 

Shane

Message Edited by Intaris on 03-17-2010 05:08 AM
EricC.
Active Participant

in the proposition, the diagram is easyer to read and the parma aren't read and write without any change.

But I recognize that if when LV compiling, it detect the read and write without any change and optimise the code, this suggestion is useless !

Ingénieur d'Application / Développeur LabVIEW Certifié (CLD)
Application Engineer / LabVIEW Certified Developer (CLD)
yenknip
Active Participant

My understanding is that the unbundle operation will create a data copy, and then the tunnels will create a data copy (all of which will be released when they lose scope); whereas the in place structure will work on the original data.

 

My reason for kudoing this idea is mainly for the space saved by moving the unbundle inside the structure, and not needing to wire through to the data output.

_____________________________
- Cheers, Ed
muks
Proven Zealot
But I still dont see\get  the advantage...
JackDunaway
Trusted Enthusiast

muks wrote:

But I still dont see\get the advantage... (Really?)


Whoa. If yenknip were right, I'd be Kudos'ing this idea like a madman. Fortunately, the compiler does not create a new allocation in this instance:

 

BufferAlloc.png

 

Use "Tools > Profile > Show Buffer Allocations..." - it's your friend. And keep in mind, typically when you are doing read-only operations on a big datatype (unbundle on a cluster, index on an array...) you will not necessarily create a data copy just because there is a branch in the wire. Below, I included an Add, to show that branch caused an additional allocation.