LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the number of controls in an object cluster

Is it possible to determine the number of elements in a cluster that is the private data of an object.  I don't know of any way to get the number of controls in a regular cluster, other than to look at the size of the "controls" reference array.  With a object's private data cluster this reference array doesn't seem to be accessible.  Thanks.
0 Kudos
Message 1 of 5
(2,955 Views)
The information exists, but is private. If you search the LAVA forums for "class API", you should find some VIs which will allow you to get the reference of the VI which has the class data definition. You can then get its front panel and get the cluster control reference and its Controls[] property.

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

Hi, tst,

 

I still have a question.

 

Is it possible to get the element number in a cluster "constant"?

 

0 Kudos
Message 3 of 5
(2,546 Views)

The original question was about a class, which is different from a regular cluster because the data is private. If you want to perform custom operations on clusters, the best option is probably the VIs found in <LabVIEW>\vi.lib\utility\VariantDataType (or something similar). I'm assuming there should be a VI there which accepts a cluster and outputs data on its structure.

 

Other options could include flattening the cluster to XML or JSON and looking at the resulting text or using something like the OpenG variant VIs, which are basically supposed to work like the vi.lib VIs.


___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(2,525 Views)

I'm sorry I ran into the wrong thread.

Very thanks to your reply. I'll try it 🙂

0 Kudos
Message 5 of 5
(2,512 Views)