LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement anything data type into subvi.

Such as “Flatten To String” has input called anything, in that we can connect any data type.

How can I implement that anything data type as the input of my subvi block? So I can connect any data type into my subvi.

Thank you

 

Amit

0 Kudos
Message 1 of 3
(3,087 Views)
Which LabVIEW development system do you have?  You have to have the Professional Development System or the Developers Suite in order to create polymorphic vis.
Message 2 of 3
(3,071 Views)
Hi Amit,

As suggested, you can use a polymorphic VI.  It is actually a bundle of vi's that select which VI to use based on the type of input that you give it.  This is a little easier to code with, but a little harder to maintain, since if generic code changes in one VI, it doesn't change in the others.

Another possibility is to use a variant control.  This will allow you to wire anything to the control corresponding to that input, and have only one vi that handles all of them.  On the other hand, with the variant, you are then responsible for decrypting what kind of input you have coming in, and dealing with it appropriately, as well as dealing with invalid input.

There may be other solutions based on the newer class systems.

Joe Z.
Message 3 of 3
(3,066 Views)