LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to take a cluster, unbundle it, and output to controls?

I have a sub-VI with a cluster of controls coming into it. After I get the cluster into the sub-VI what is the best way to unbundle it and apply the values to the controls in the sub-VI? I am trying to stay away from unbundling it and then wiring a local variable of each control to the unbundled name. What other ways are there of performing this type of operation? Thanks in advance for any help.
 
Troy
0 Kudos
Message 1 of 5
(2,973 Views)
Hi Troy,

well you could work with clusters directly. This way there is no need to unbundle and bundle again...
Otherwise you can work like this to change values in a cluster:

(Yes I know, the code is quite senseless...)

Message Edited by GerdW on 07-26-2007 04:21 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,968 Views)

I know what you mean as far as working with clusters directly. However with this particular VI this is the way, with the unexpected path it has taken, that I want to go in. I do not exactly understand what your example is doing. What I want to do it take each elements value in the cluster, not the same data types, and assign it to the associated control in my sub-VI. So I have one element in the cluster that is a string that I want to sent its value to the string control in the sub-VI. The next element is a numeric which I want to send to the numeric control of the sub-VI, and so on. Any ideas for this?

Thanks for any help.

0 Kudos
Message 3 of 5
(2,957 Views)
Presumably this is some subVI that displays itself to the user and you are being fed some initial values for the controls or something. Well, if the controls are individual controls, and the input to the subVI is a cluster then the only thing you can do is to unbundle the cluster to get the individual values. With this you can use either a local variable or a property node (since they're controls) to set the values.

Your other option is to simply place the controls into a cluster that matches the input cluster. Then, you can just wire the input cluster to a local variable of your front panel cluster.
0 Kudos
Message 4 of 5
(2,949 Views)
Your assumption is correct. Ok the option sounds like it would make the most sense. Again thanks for the help.
 
Troy
0 Kudos
Message 5 of 5
(2,944 Views)