LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView VARIENT data type?

LabView User Group:
I would like to utilize a VARIENT data type so that I can write one
subVI to
handle all of my applications file save and retrievals. It doesn't
appear that NI included this data type when they designing the G
programming language. Does anyone know if it is included or, if not ,is
there a work-around so that I can pass clusters with variable types of
included data into a subVI.
Thank-you for you assistance,
Brian Wells
Space Power Institute
0 Kudos
Message 1 of 2
(1,534 Views)
There's no polymorphic/variant data type in LabVIEW at this time, though it
has been much sought-after by a number of users.

In a project I was involved in several years ago, we achieved some
polymorphic functionality by making extensive use of the Flatten to String
node and passing different data types that way. The trick is to somehow
pass along info that indicates which inherent type is stored in the string,
then ensure that there's a case in the diagram to unflatten that type and do
the appropriate operations on the data.

Until there is a true polymorphic type, this is pretty cumbersome and might
not be the best way to go if you can alter your design to use different
subVIs for different types.

Regards,
John Lum
National Instruments

Brian Wells wrote:

> LabVie
w User Group:
> I would like to utilize a VARIENT data type so that I can write one
> subVI to
> handle all of my applications file save and retrievals. It doesn't
> appear that NI included this data type when they designing the G
> programming language. Does anyone know if it is included or, if not ,is
> there a work-around so that I can pass clusters with variable types of
> included data into a subVI.
> Thank-you for you assistance,
> Brian Wells
> Space Power Institute
0 Kudos
Message 2 of 2
(1,534 Views)