LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

branching cluster creates copies%3F

Hi All,

Does branching a cluster create a new copy of the cluster?

 

I have a cluster of ~20 elements and I branch it to unbundle different elements f of the cluster.

 

clusterbranching.PNG

I do not write to the cluster wire but branch it to read elements out of it. Will the bracnhing shown in the pic create copy of the cluster?

I am not unbundling it in a single unbundle to make code look neat and clean.

0 Kudos
Message 1 of 4
(2,203 Views)

Define "make copies". It could possibly create temporary duplicates of the cluster in the memory before extracting the value; however, it will not make duplicates on the front panel, or for purposes of writing to the cluster.

0 Kudos
Message 2 of 4
(2,200 Views)

Hello LVCoder,

 

Probably, but it depends on where and how you're using these branches (I imagine it's not quite as straightforward as the image you provided)

 

To check whether or not a copy is being made, turn on Show Buffer Allocations as per this help document:

 

LabVIEW Help: Show Buffer Allocations Window

http://zone.ni.com/reference/en-XX/help/371361K-01/lvdialog/show_buffer_alloc/

 

Regards,

Tom L.
0 Kudos
Message 3 of 4
(2,199 Views)

@LVCoder wrote:

Does branching a cluster create a new copy of the cluster?

 

I do not write to the cluster wire but branch it to read elements out of it. Will the bracnhing shown in the pic create copy of the cluster?


Branching to read, as shown in your image, will not create additional copies of the cluster. Branching and copies are NOT the same thing. Copies only happen at functions and subVIs, not on wires. As far as the compiler is concerned, any number of unbundles of the same cluster are the same as a single unbundle of that cluster, since the two are equivalent - they could replace each other by just changing wires.

0 Kudos
Message 4 of 4
(2,180 Views)