From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get all LV class types returns private classes. How can I remove those from the list?

Solved!
Go to solution

If I get a reference to a class specifier constant on the block diagram, and use the scripting property AllTypes[], in addition to the types shown when you click on the constant to select the type, are some private classes (eg CopyItem, CopyOperation). If I want to present a list similar to what is actually selectable, I would need to remove those private classes. Is there a way I can do that programatically? 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 4
(2,199 Views)

Sure, there is a way. There always is a way. There's no red carpet though.

 

You can get the private or scripting property, but you need a property node.

 

You'll need a DUT vi with a property node. Set it's class to the class of the ClassSpecifierConstant. Then set it's item to the item of interest. Then, read the Flags.IsPrivate or Flags.IsScripting property. These are brown nodes, so you need secret scripting stuff enabled.

 

EDIT: I'd advice to do this once, for all classes. Store the info in a map (FGV or even a constant), and every time you need it, you can get it fast. Details depend on your needs.

Message 2 of 4
(2,182 Views)
Solution
Accepted by topic author littlesphaeroid

Thank you! I just found these private properties related to the properties on a property node, and then read your message. For the record, private properties are documented on the LabVIEW wiki, eg:

 

https://labviewwiki.org/wiki/PropertyItem_class

 

I agree reading these property properties once for all properties and caching the results is a good idea, as it can take a second or so to process all the properties available for a given class.

 

For classes, this is essential, because the only way I know if a class is private is to see if *all* of its properties are private, and this takes some time to figure out:

 

determine private class.png

 

Incidentally, I found at first that I could not programatically set a property node to a private property, even though with the ini key set the private properties show up in the right-click dialog for the property node. Luckily I don't need to do this. But then I discovered that there is a private method called SetProperties_AllowPrivate. Ah ha!

 

At the end of the day, I think it's going to be faster to simply maintain a list of not-private top-level classes in an array constant and filter based on those. 

 

 

 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 3 of 4
(2,158 Views)

I’m glad the LabVIEW Wiki was useful.

 

I have also created some VIs that can help do some of the VI Server stuff Wiebe suggested. Located on GitLab, here . 

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



0 Kudos
Message 4 of 4
(2,142 Views)