08-10-2023 06:15 AM
So maybe I'm just missing something from my LabVIEW class knowledge, but how do you create a property for something that is not in the class data. I see that you can override the properties of the base control, but for example in the TreeDirectory control, there's a "Directory" property. How was that created?
Solved! Go to Solution.
08-10-2023 06:42 AM
You are correct, when creating a data accessor. In that case the code is scripted to only bundle or unbundle data from the class private data. However, you can right-click the class or a virtual folder in the class and create a Property Definition Folder. Then create your read and/or write (set and/or get) property VIs. The requirement for a property VI in these special folders is that it has the class as input and output, the error as input and output, and either one input or one output of any type. The code inside of it can really be anything you want it to be. It doesn’t have to be just a bundle or unbundle. In the case of QControls, a lot of the time you’ll be accessing you State Data DVR inside one of these property VI. Hope this helps.
PS I am in the process of creating a State Data Accessor scripting tool to help make those types of property VIs.
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
08-10-2023 07:11 AM
Thank you. I just learned something today, and it makes LabVIEW classes even better. 😀