LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 7.3 and up: How to edit clusters being passed to sub VIs?

Hello,

 

Here is what I've been doing:

 

In an effort to keep VIs neat and clean I've been passing clusters to subVIs.  In order to update the cluster from the subVI I've followed this procedure:

 

1. Create a reference to the cluster

2. Drag the reference from the block diagram of the calling VI to the front panel of the subVI

3. Create property nodes pointing to the refnum and write to those, updatig the data in the calling VI's cluster.

 

I do all this to obtain performance similar to "passing by reference" in traditional programming.  It works great up until one point:

 

When I edit the cluster, I need to repeat step #2, since the old refnum no longer matches.  I'd like to find a way around step #2 to begin with since it is rather ackward to begin with- I usually end up having to resize several windows in order to successfuly create the refnum to begin with.

 

Any suggestions?

 

Also, if someone can clear this up for me... The refnum which is created has a red start on the icon- is this because it is a strict typedef?  What does removing that do exactly?

 

Thanks,

 

Dave

 

0 Kudos
Message 1 of 2
(2,225 Views)

Hi Dave,

if you change the type of your cluster then the reference to it will also change, so you have to do step 2. You can use type defs. to  change only one place.

The red star shows you, that the type of the data is included into the refernce. You can use more functions then. You can see it if you connect a property node to such a refnum. You shall have more properties if the star is available.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 2
(2,217 Views)