LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Get the possible properties for a class

Solved!
Go to solution

Does anybody know how to get  a list of the public properties for a class?

Preferably the tool looks like the app method 'Get Class Methods'

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 1 of 10
(7,534 Views)

LVOOP classes only have private properties. To provide public access to a property, you have to write an accessor VI. There's no standard pattern for naming accessor VIs, so there's no generic tool for finding and enumerating them.

VI Server classes list all their public properties when you click on a property node that's configured for that class.

Or did you mean some other kind of class?

0 Kudos
Message 2 of 10
(5,674 Views)

No you understand correctly I mean the properties that you (externally) access via property node. However I need the list programmatically for documentation function. I hope someone allready had made a tool that could retrieve the list.

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 10
(5,674 Views)

Not seen anything specific but I would think, if it is for development purposes I would be tempted to take a look at the project API. As they are a special definition in the project I suspect there would be a way to pull it through this.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 4 of 10
(5,674 Views)

You should be able to open a reference to the LV class and then iterate through its project items looking for any that are of type PropertyFolder and then testing that their access scope is public.

0 Kudos
Message 5 of 10
(5,674 Views)

Yes the project API gave me the solution, I will post it after polishing things.

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 10
(5,674 Views)
Solution
Accepted by TCPlomp

Here's the working code:

Class-Item.lvclass_GetProperties_BD.png

In short I get all property folders, iterate over them, get all containing VI's, check if they match the correct connector pane, the location of indicators and controls.

The case structure should have the case 'Public .. Community'

Ton

PS AQ why is the enum of 'Scope' in this order:

  • Invalid
  • Public
  • Private
  • Protected
  • Community
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 10
(5,674 Views)

Why bother checking the conpanes? If they're in a property folder, they either match the required conpane or the class is broken. If there are two VIs, then set both the read and the write. If there's only one, just check which of the two terminals is wired. Much much faster than the code you've written.

> AQ why is the enum of 'Scope' in this order:

Because protected scope was added after libraries were finished. Community scope was added three versions of LV after the others and enums can only be extended by adding to the end of an enum (otherwise you break existing code).

Message 8 of 10
(5,674 Views)

I do extensive checking because I thought that it was possible to have more than two VIs in a property definition folder. However checking in LV 2011 and 2012 prove me wrong. 2010 perhaps?

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 9 of 10
(5,674 Views)

TCPlomp wrote:

2010 perhaps?

Nope. Never.

0 Kudos
Message 10 of 10
(5,674 Views)