LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically obtain disabled items within Enum, Array, etc.

Solved!
Go to solution

Hi,

 

I am attempting to obtain the disabled state of every control and indicator and save this to a configuration file for a specific VI; which includes a broad range of arrays, strings, booleans, enums, etc. For simple objects, such as a string, that only have a single value this is easy using property nodes like this:

 

 

For more complex objects, such as an enum, that have multiple values the above method only works for the enum object itself not the items within. If a property node is created for one of these more complex objects there is a property called "DisabledItems[]" which is not available using the Ctl property node (I assume because not all controls and indicators have multiple items). I would like this function to be compatible with all VIs so manually creating property nodes for the more complex objects is out of the question.

 

 

Does anyone know how to generically and programmatically obtain the disabled items of one of these more complex objects? The same goes for arrays, clusters, rings, etc. 

 

Thanks for any help,

Aric

0 Kudos
Message 1 of 3
(2,540 Views)
Solution
Accepted by topic author abeaver

You can use the Class Name or Class ID property to find out what kind of control it is then use the To More Specific Class to cast the RefNum to the correct class.  You then have access to the properties you're interested in.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
Message 2 of 3
(2,516 Views)

Great! That works well. Here is what I did.

 

final.JPG

Message 3 of 3
(2,495 Views)