LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing cluster of moderately large size across vi's

If I have a choice of passing in a cluster or an element of cluster from one vi to another
vi which one should I use? I would like to pass in the cluster for convenience, but I am not
sure if the cluster is passed by reference or memory copy internally. The cluster is about
200 bytes and the function will be called repeatedly in a 10 msec timer.

Any suggestion will be much appreciated. Thanks.


Ratin
0 Kudos
Message 1 of 3
(2,501 Views)
Unless you are modifing the value of any of the elements of the cluster, LabVIEW shouldn't make a copy of the cluster as it's passed around.

If you are modifing a value, it may, or may not make a copy. If you have LabVIEW 7.1, there's a tool you can use to see where LabVIEW creates copies of data. Open the block diagram and in the tools menu, go down to 'Advanced', then select 'Show Buffer Allocations'. This will place a small black box on the terminals where data is copied.

I generally pass the entire cluster and unbundel the items I need inside the subVI.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 3
(2,497 Views)
Thank you Ed for your suggestion. Passing the cluster minimized the space
and reduce the clutter that I had before, Now I hope it doesn't have any
performance hit. Thanks again.

Ratin
0 Kudos
Message 3 of 3
(2,481 Views)