LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Naming cluster elements...

Hi,

i get some trouble with bundle elements to cluster. During runtime i
call a vi x-times with different input selections and it gives me
different output data. If i bundle all data to a cluster now each
element get the same label (indicator of the sub-vi). How can i change
the label to exactly identify an element by using the unbundle by name
later?

At the moment i have a selfcreated invisible cluster which is the target
of the bundle function. There i set the labels to the needed ID. After
that i use a local variable of that cluster for later unbundle by name.

Is there another way avaible that i don't need this indirection over the
selfcreated cluster?

Thanx,
HEnrik
0 Kudos
Message 1 of 5
(3,385 Views)
> i get some trouble with bundle elements to cluster. During runtime i
> call a vi x-times with different input selections and it gives me
> different output data. If i bundle all data to a cluster now each
> element get the same label (indicator of the sub-vi). How can i change
> the label to exactly identify an element by using the unbundle by name
> later?
>
> At the moment i have a selfcreated invisible cluster which is the target
> of the bundle function. There i set the labels to the needed ID. After
> that i use a local variable of that cluster for later unbundle by name.
>
> Is there another way avaible that i don't need this indirection over the
> selfcreated cluster?
>


I think I'd probably go to the bundle node, popup on the
middle terminal, and create a
constant or a control to
feed into the middle terminal. If necessary, show the
name labels, and change the names of the elements. Then
wire the cluster into the middle terminal.

The middle terminal on the bundle is rarely used, but
very handy. It completely determines the datatype,
and lets you replace the value of any input that is
wired.

Greg McKaskle
Message 2 of 5
(3,385 Views)
Hi Greg,

that's what i need. I used this bundle function often with a cluster as
input but why i didn't use a constant? *g

Thnx
Henrik


Greg McKaskle wrote:
>
> > i get some trouble with bundle elements to cluster. During runtime i
> > call a vi x-times with different input selections and it gives me
> > different output data. If i bundle all data to a cluster now each
> > element get the same label (indicator of the sub-vi). How can i change
> > the label to exactly identify an element by using the unbundle by name
> > later?
> >
> > At the moment i have a selfcreated invisible cluster which is the target
> > of the bundle function. There i set the labels to the needed ID. After
> > that i use a local variable of that cluster for later unbundle by name
.
> >
> > Is there another way avaible that i don't need this indirection over the
> > selfcreated cluster?
> >
>
> I think I'd probably go to the bundle node, popup on the
> middle terminal, and create a constant or a control to
> feed into the middle terminal. If necessary, show the
> name labels, and change the names of the elements. Then
> wire the cluster into the middle terminal.
>
> The middle terminal on the bundle is rarely used, but
> very handy. It completely determines the datatype,
> and lets you replace the value of any input that is
> wired.
>
> Greg McKaskle
0 Kudos
Message 4 of 5
(3,385 Views)
Hi Mr.Skupin

Henrik Skupin wrote:

> i get some trouble with bundle elements to cluster. During runtime i
> call a vi x-times with different input selections and it gives me
> different output data. If i bundle all data to a cluster now each
> element get the same label (indicator of the sub-vi). How can i change
> the label to exactly identify an element by using the unbundle by name
> later?

Would you mean that cluster values have to be given different
labels depending on called sub-vi ?
If so, I think of some ways to do on with:

1. Using "Cluster to array" and preparing character arrays
consisted of each label names. You can use "Searching array"
to identify index number and choose a needed element from
the cluster with identified index number.
2. Getti
ng a needed element from the cluster by "Unbundle" with
"Priority number".(You can confirm it on a front panel of
the vi by temporally displaying.) And then, in the sub-vi
you can put appropriate label into "Attribute Node>>Name".
In some cases appropriate labels' array to identify suitable
elements is possibly needed, same as I described above 1.
It will give you results exactly same as what you would wish
to do as I understand.

I think the way you mentioned in later parts may be one of
precious solutions. When elements of the cluster are not so
many it will be the most effective. And unless every elements
have same types, the way of 1 will be useless.

Hopefully for your goodness,
Tomoya ITO
--ito@rd.fujitec.co.jp
--Mechanical engineer
0 Kudos
Message 5 of 5
(3,385 Views)
Hi Tomoya,

thnx, that was something new for me but that is not really what i
wanted. I just looked for an easy way to give the cluster elements a
special label.


Henrik
0 Kudos
Message 3 of 5
(3,385 Views)