LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generic data type?

How do you make a indicator or control that will accept any data type ie:
string, uint16 etc...

Thanks in advance,

-Ben
manthey@dim.com
http://www.dimensional.com/~manthey
0 Kudos
Message 1 of 3
(2,329 Views)
manthey@dim.om (Benjamin J. Manthey) wrote:
>How do you make a indicator or control that will accept any data type ie:
string, uint16 etc...>>Thanks in advance,>>-Ben>manthey@dim.com>http://www.dimensional.com/~manthey

Ben,
It really depends on what you need it for.

For user interface, a string control will let you enter strings, numbers
(any style), booleans, or paths. You can then parse it in the diagram.
A string indicator can also show a string, number, boolean, or path. This
is fine if you have at least some idea of what to expect. This doesn't work
directly for RefNums.

If you are interested in passing from one VI to a subVI, you may want to
flatten to string and unflatten from string on the other side.

Otherwise, no there is no control/indicator presen
tly in LabVIEW (as far
as I know) that is polymorphic.

I hope that this helps,
Bob Young
0 Kudos
Message 2 of 3
(2,329 Views)
Seconding Robert, there is no way, as of LabVIEW 5.1, for the user to create VIs with polymorphic
terminals, similar to the polymorphic yellow function nodes in the function palettes.

The flatten approach is the best workaround I am aware of. You can achieve some level of data-handling
flexibility this way (if not true polymorphism) by writing handling routines in case structures that
process the data depending on the type, but of course you'll have to reflatten the result if you want
to pass it out of the subVI in a pseudo-polymorphic manner.

This is a topic that has been on the wishlist for a while, and I know that the developers are
considering how to incorporate it in a future version of LabVIEW.

Regards,
John Lum
National Instruments

Robert Young wrote:


> manthey@dim.om (Benjamin J. Manthey) wrote:
> >How do you make a indicator or control that will accept any data type ie:
> string, uint16 etc...>>Thanks in advance,>>-Ben>manthey@dim.com>http://www.dimensional.com/~manthey
>
>
>
> If you are interested in passing from one VI to a subVI, you may want to
> flatten to string and unflatten from string on the other side.
>
> Otherwise, no there is no control/indicator presently in LabVIEW (as far
> as I know) that is polymorphic.
0 Kudos
Message 3 of 3
(2,329 Views)