LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Polymorphism of inputs in SubVIs-similar to Queue

Hi,

I would like to implement the polymorphic behavior exhibited by the Queues, in the VIs that we develop.

To explain this more, I have attached a file along with this email. In the "queue1" part, when we wire a datatype to the input of the "Obtain Queue" VI we can see that all the queue VIs wired to the same reference exhibit the same datatype. If we do a create control/indicator on the enqueue/dequeue VIs, the control/indicator created will be the same as that of the datatype wired in the "Obtain Queue" VI.

As in "Queue2" part, if we replace the simple cluster in the "obtain queue" VI with a complex cluster. We can see the datatype of enqueue/dequeue VIs change as well.

I would like to implement this feature in the VIs we develop as it will make the VIs highly flexible and reusable in many situations. Is this possible?

I would gladly appreciate any help.

Thanks
KT
(Kumar.K.T)
0 Kudos
Message 1 of 5
(2,772 Views)
Buiding polymorphic vis is possible only with the Professionnal Development System.

Search the LV Help for "Polymorphic", all the steps are described thoroughly.
There is also an example here

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 5
(2,762 Views)
Hi,
We can also do this but for that we will be creating a VI for every data type that we want to process. If we want to use any datatype but only one VI , then how can we do this.

One solution that comes to my mind is variant. But there we have the overhead of providing the datatype when we want to get back the data. Is there a way where the user wouldnt have to worry about what the datatype is, the same way that we dont have to worry about the datatype in queues?

Thanks
KT
0 Kudos
Message 3 of 5
(2,758 Views)
Hi

I think that's not possible.

In an older thread (app. 2 years ago) the topic is also discussed and it was mentioned that there is no possibility to do what you want.

I work with LV7.0 and wanted to do something like you and found no way except creating different vis for each datatype.

Maybe there's a way in LV7.1.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 5
(2,745 Views)
becktho wrote:
> Hi<br><br>I think that's not possible.<br><br>In an older thread (app. 2 years ago) the topic is also discussed and it was mentioned that there is no possibility to do what you want.<br><br>I work with LV7.0 and wanted to do something like you and found no way except creating different vis for each datatype.<br><br>Maybe there's a way in LV7.1.<br><br>Thomas

No there isn't and there won't be any such possibility soon. You have to
go with polymorphic VIs or use Variants.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 5
(2,721 Views)