LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVoop different data type between childs question

So i am kind of new on this, i have some very basic functions working and made a base class and have some override methods with dynamic dispatch etc..

 

so to put things easy.

 

i have  PcbBase Class. which handles the functions that PcbA and PcbB have in common. How every these  Childs in some cases will require a it's own typedef cluster to parse a communication message that answers to the same command. i would like to pass that data out to other VI's

 

 

so how do i do that? how can i make the PcbBase class select the typedef control to parse the messag automatically and pass  it out.  if the dynamic dispatch VI will require always the same data type.

 

i tried to find some information online but i could not find a clear answer to this.

 

thanks

 

CLAD, CTD
0 Kudos
Message 1 of 8
(3,806 Views)

The beauty of a dynamic dispatch VI is that it can handle the same data differently depending on the class that gets passed in. Each child class can have its own data separate from the other children, so you want to put your separate data in to each child class's data type-def.

 

I'm not 100% clear exactly what you're trying to do with the data, so maybe mapping out an example of the dataflow would help get your point across.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 8
(3,803 Views)

lets see if i can explain better with this pic

CLAD, CTD
0 Kudos
Message 3 of 8
(3,783 Views)

according to some tutorials passing a Variant is  a NO NO for this problem

CLAD, CTD
0 Kudos
Message 4 of 8
(3,773 Views)

What you're trying to do is pretty simple, but you're not saving much work becuase you're going to need a dynamic dispatch VI for each child class to handle its own data differently. The benefit of using classes to do what you're trying to do is it simplifies your block diagram a lot and forces you to standardize the way you do the coding. Each child class is going to have its own datatypes and its own dynamic dispatch VI to handle its data. When each class is passed to the Parent class's dynamic dispatch VI, the code will run the Child class VIs.

 

See attached code to show you what I mean.

Dynamic VI Testing.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 5 of 8
(3,753 Views)

buton wrote:

i have  PcbBase Class. which handles the functions that PcbA and PcbB have in common. How every these  Childs in some cases will require a it's own typedef cluster to parse a communication message that answers to the same command. i would like to pass that data out to other VI's


The real question is what are you trying to do with this data?  If you are actually passing the cluster out, then the whole point of Dynamic Dispatch is thrown out the window since you will have to call the specific class to get the data type you want.  You need to handle the data from within the class itself.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 8
(3,736 Views)

i would like to use the data on Teststand, 

 

But you are right about that "i am throwing out the window the concept of dynamic dispatch" just wanted to see what it can be done...i can get away by outputing my data on an array and i could index it how ever i want on testand.

CLAD, CTD
0 Kudos
Message 7 of 8
(3,720 Views)

Thank you for the example james.

 

ill put some data inside the ctrol to do some other stuff

CLAD, CTD
0 Kudos
Message 8 of 8
(3,705 Views)