LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possibility to programmatically create a "VI for override" for a LVOOP class?

Solved!
Go to solution

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!!

 

0 Kudos
Message 1 of 7
(5,055 Views)

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

Message 2 of 7
(5,034 Views)

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:

 

 

  1. Copy the VI to a new location.
  2. Add the new VI to the new class
  3. Change the input terminals to the new class
  4. Optional - script in a call to the parent VI
You may want to request this as a new feature.  Seems like it would be useful.

 

Message 3 of 7
(5,027 Views)
Solution
Accepted by topic author dlanger

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:

 


  1. Copy the VI to a new location.
  2. Copy the VI's original class to the new location (just temporarily needed)
  3. Add the new VI to the new class
  4. Change the input terminals to the new class using VI scripting
  5. Delete the VI's original class at the new location

Thanks a lot for the help!

Message 4 of 7
(5,009 Views)

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

David
www.controlsoftwaresolutions.com
0 Kudos
Message 5 of 7
(4,506 Views)

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.

0 Kudos
Message 6 of 7
(4,148 Views)

(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.

0 Kudos
Message 7 of 7
(3,115 Views)