LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy multiple dispatch vi to new child class

Hi, I have just started with LVOOP and while I'm pretty sure I have a good understanding of the overall theme, there is one problem I foresee if I continue.

 

Situation:

BoardType is parent of classes CC2600 and CC1300. Currently the child classes are just empty place holders.

Almost all the methods in the child classes will be of dynamic dispatch type (currently only one).

From what I understand a dynamic dispatch must be available in all child classes plus parent class in order to work as intended. 

 

 

Capture204.png

 

Problem:

If I would go forward and implementing LVOOP this would require approx 30 dynamic dispatch vis for each class. I can right click but for just these two children that's 60 + 30 vis I must create manually. I would much prefer just to create a template once and then just basically drag and drop 30+ new vis for each new class that is created.

Is there a way I can define a set of template dispatch vis in the parent BoardType and have them added to all the child classes? 

I tried the save as copy, but the problem is that I still have to replace the connector pane to represent the new owning class.

 

If it helps here's a very basic block diagram of what's going to happen, just after Reset.vi there will be a lot of other dynamic dispatch vis.

 

test_vi.png

 

 

Thanks in advance.

 

Michael

0 Kudos
Message 1 of 5
(3,039 Views)

You don 't need to define a dynamic dispatch VI for every level of the hierarchy.

 

The next lower version (parent, grandparent and so on) is automatically chosen.  Don't duplicate a dynamic dispatch VI if you don't need different code within it.  The rest is handled automatically.

 

Shane

 

PS In other words, only define a new DD vi if the code changes.

0 Kudos
Message 2 of 5
(3,022 Views)

Thanks for the quick answer.

"Don't duplicate a dynamic dispatch VI if you don't need different code within it."

In other words - "Create a dynamic dispatch vi if you need different code in it".

 

This is my problem, different childs has different code for the same function. But I understand what you mean.

 

I wrote a scripting vi which takes in all DD vis and changes the connector pane programatically to a different class.

 

Michael

 

0 Kudos
Message 3 of 5
(3,004 Views)

Maybe this will help you:

 

LVOOP Assistant

0 Kudos
Message 4 of 5
(2,998 Views)

From the OP it sounded like you were literally just copying from the parent.

 

What I tend to do is finish one child class and then save a copy to a new name and change the internal data (if required) and DD vis (if required).

 

I do agree though that these kinds of operations could be hugely simplified using helper programs.  Give the link provided by others a try.

 

Shane.

0 Kudos
Message 5 of 5
(2,980 Views)