LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can a component be added to an existing cluster programmatically?

I want to create clusters programmatically, meaning that I want to give the elements types and names (taken for example from a saved .llb file) and have the cluster generated. Also, I don't know how to add elements in an existing cluster, not of course by using the bundle function or manually in the front panel.
 
Thanks
0 Kudos
Message 1 of 3
(3,300 Views)

Clusters are fixed data structures - you're not supposed to modify them programmatically.

You might want to look into an array of variants (look in the advanced palette) or into flattening. A variant can hold several data types and you will just need to handle your different types by using something like a case structure or a polymorhic VI for the conversion. You can create a cluster which will hold the name string, type enum and data variant and build that into an array.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(3,276 Views)

Hi dtsantl,

Like tst says, your best bet is probably the Variant.  NI hasn't yet unlocked the power to programmatically create diagram objects (... though I believe this capability has been lurking in LabVIEW for 5 or 6 years).  One can create "from scratch" a Variant that represents an arbitrarily complex cluster, but to convert the Variant to the cluster, the cluster typedef needs to be available already. Smiley Sad

Cheers!

 

Message Edited by Dynamik on 03-01-2006 02:20 AM

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 3 of 3
(3,266 Views)