LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a vi that can be connected to any type of array

I would enjoy to create a vi that can perform an operation (like resizing) on any type of array (array of string, of cluster, of num,...): Which type of control or indicator could I use for this purpose? Any Idea?
Thank's for your help
0 Kudos
Message 1 of 3
(2,601 Views)
Olivier,
to do this you have to use a variant input. You can wire any type of data to a variant input. Inside the VI you flatten the variant to a string. The flattened string of an array contains both data and length of the array. You reshape the array manipulating the string. When done, you unflatten the data to a variant and output it from the VI. The caller has to convert the variant input to the source array type. OpenG.org provides a quite extensive toolkit to manipulate variant data. Some VIs specifically manipulates arrays. To see a description of VIs go to : http://opengtoolkit.sourceforge.net/lvdata/index.html
LabVIEW Data Tools can be downloaded from http://sourceforge.net/projects/opengtoolkit/
You need both packages lvdata AND error.


LabVIEW, C'est LabVIEW

Message 2 of 3
(2,601 Views)
Hi,

Look for Polymorphic VIs in the help, if you want to do it 'by the book'...

A variant as input works, but it is a 'quick and dirty' (=not standard,
undocumented) way of doing it. It would also require experience to do it
this way, and lots of debugging to make it yourself.

If there is something on OpenG to do it, I'd use this.

Regards,

Wiebe.


"Olivier" wrote in message
news:506500000008000000076C0000-1031838699000@exchange.ni.com...
> I would enjoy to create a vi that can perform an operation (like
> resizing) on any type of array (array of string, of cluster, of
> num,...): Which type of control or indicator could I use for this
> purpose? Any Idea?
> Thank's for your help
0 Kudos
Message 3 of 3
(2,601 Views)