04-20-2011 06:18 AM
I am now quite a step further with my LV class generator VI that I mentioned previously (see here). However, I am stuck again: I would like my generator VI to automatically create a new "VI for override" (i.e., overrides a method of the parent class) for the newly created class.
In the VI server interface, I haven't found an invoke node to create a new "VI for override". Is there any way to do this, maybe with a wrapper VI like the one I was provided to programmatically set the parent class of a LVOOP class?
Thanks in advance for any help!!
Solved! Go to Solution.
04-21-2011 06:44 AM
Hi,
I also looked through the properties and methods that are available, but did not see anything that allowed to directly create a VI for override.
What you could do is to make a copy of the VI to override and use scripting to just change the datatype of the dynamic dispatch input to the child class. I'm afraid that pretty much any solution here will be manual.
Regards,
Joseph
04-21-2011 08:23 AM
FULL DISCLOSURE: I have not done this.
I agree with jtagg that there is not a direct method, but he left out a step. You need to add the new VI to the new class library. So the steps would be:
05-04-2011 04:17 AM - edited 05-04-2011 04:18 AM
It more or less works as you suggested, but it requires two additional steps: since the scripting VI that replaces the front panel control loads the original control at run-time, the old class has to be copied as well (and deleted again afterwards). So the complete procedure (tested and working!) is:
Thanks a lot for the help!
10-23-2015 03:50 AM
Hi,
does any one have any code snippets or examples to do this? I have been able to create the override VIs but not been able to change the terminals or icons using scripting.
Thanks
05-26-2017 04:48 PM
Does anyone have an example of this working? I found a promising VI at
C:\Program Files (x86)\National Instruments\LabVIEW 2015\resource\Framework\Providers\LVClassLibrary\NewAccessors\CLSUIP_CreateOverride.vi
but the block diagram is locked and I couldn't get it to work in an obvious way.
05-29-2020 02:15 PM
(I realize this is an old thread, posting for posterity.) I created some VIs that have additional documentation that I wanted to use as the default override. This snippet copies the template, adds it to the target class, then replaces the control at the top left (index 11) with the target class control and sets the terminal to dynamic dispatch. Hope it helps someone.