LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extracting array of labels in a cluster

How can I extract an array of strings, containing the label of objects in a cluster?

Thanks,

LV 8.6 on Windoze XP
0 Kudos
Message 1 of 14
(9,011 Views)
Use a reference to the cluster and a property node. If the cluster can contain other clusters and you want the names of the objects in those subclusters, things can get messy fairly quickly, but it can be done. Open G may have some tools for this, but I am not sure.

Lynn
0 Kudos
Message 2 of 14
(9,006 Views)
I I hear what you're saying.  The problem is I haven't found where the labels if the children objects are hiding.

Can you please tell me where to look and how?

Thanks
LV 8.6 on Windoze XP
0 Kudos
Message 3 of 14
(8,986 Views)
Here is a VI I put together to explore access to all the controls on a panel. I need to change the captions (not the labels) programmatically for language localizations. Both language versions of each caption may be stored as diagram constants, or, more flexibly, in a configuration file. This VI is not documented and has a lot of rough edges as I did not plan for anyone but me to use it and only as a learning tool. LV8.20.

Lynn
Message 4 of 14
(8,974 Views)
Assuming you're using LabVIEW 8.2, try this VI, which makes use of the Variant VIs introduced in LabVIEW 8.2 (OpenG provides a similar VI).  Convert your cluster to a variant and then wire it into this VI.  The outputs are:
1) an array of strings containing the names of all the child clusters
2) an array of integers, which are indices of the parents of each child cluster
3) an array of strings containing the names of all final child elements
4) an array of integers, which are the indices of the parents of each final element
5) an array of enumerations corresponding to the type of each final element

I use this in a number of situations, including a VI that can populate a tree control to match a cluster, which I'd be happy to post too if that's of use to anyone.
0 Kudos
Message 5 of 14
(8,967 Views)

Hello nathand,

 

is it possible to do the reverse, that is to say from a

nested variant tree, cast it into a cluster an bundle

it into another existing cluster ?

 

David Koch

0 Kudos
Message 6 of 14
(8,154 Views)

I don't think there's a single VI that does what you want, but the OpenG Variant tools might provide enough help to make it possible to build one. There are tools there for building a cluster from a Variant, which basically build up a flattened string representation of the cluster which you can then unflatten.

0 Kudos
Message 7 of 14
(8,131 Views)

Hello Labview Super Sayian, could you please check my

proposed solution here :

 

https://forums.ni.com/t5/NI-TestStand/Enqueue-Teststand-cluster-to-Labview-return-a-cluster-by/m-p/3...

 

It is still a WIP though...

 

David Koch

0 Kudos
Message 8 of 14
(8,058 Views)

@Kochise wrote:

 

is it possible to do the reverse, that is to say from a

nested variant tree, cast it into a cluster an bundle

it into another existing cluster ?


I'd like to see an example of what you are thinking, but I think my XNode posted here could be a start to making this work.

0 Kudos
Message 9 of 14
(7,965 Views)

Hello Hooovahh, thanks for the feedback.

 

Here's my current progress, I'm blocked

though.

 

The idea is to recreate a nested variant

from any input (cluster elements or from

a PropertyTree incoming from Teststand)

and cast it using 'VariantToData'.

 

Please refeer to the related topics :

 

http://forums.ni.com/t5/NI-TestStand/Enqueue-Teststand-cluster-to-Labview-return-a-cluster-by/m-p/30...

http://forums.ni.com/t5/NI-TestStand/How-to-use-LabView-s-created-notifiers-in-Teststand/td-p/305986...

http://forums.ni.com/t5/LabVIEW/Convert-Labview-cluster-name-to-Teststand-container-name/m-p/3067857

 

David Koch

0 Kudos
Message 10 of 14
(7,938 Views)