LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting DVR getters and setters

Hi all,

suppose we have a LVOOP framework that uses Data Value References heavily. So, we create a cluster with all the class data members, and then in the "Private data for [class]" control we just store the DVR.

As you can imagine, creating getters and setters for those is rather cumbersome. So, I would like to script this, and my question is - is what I want to do even possible?

My plan:

Create a script which would enable the developer to select a class and then run the "generate getters and setters function"

The function should:

- inspect the "Private data for [class]" control for all the DVR variables,

- check what clusters they "point to",

- open those clusters and read all the members,

- list those members to the user (like LV does for normal classes now),

- when the user selects a member, generate a getter and/or setter for it out of some template:

   - the templeate would use in-place structures to "open DVR" and again in-place structure to read/modify the cluster members

Doable? Yes/no/maybe?

Thanks in advancew and best regards, Miha

0 Kudos
Message 1 of 3
(4,489 Views)

This is certainly possible.  You may find the code in <vi.lib>\Utility\VariantDataType useful for this endeavor.  The current LabVOOP interface has this functionality for normal class data.  You can probably leverage the templates for you functions.  See Darren's Nugget for where they are.  Good luck.  Let us know if you need more information.

0 Kudos
Message 2 of 3
(2,966 Views)

Of cause it’s possible; I do that in the GOOP Development Suite.

Start by creating a Template VI.

Open a reference to the project and then the lvclass item.
Then save a copy of the template into the class and add it to the class.

Then replace the class controls and update the control/indicator and update the Bundle/Unbundle name.

Cheers,

Mikael

0 Kudos
Message 3 of 3
(2,966 Views)