LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I pass unknown data types to a vi

I would like to create a vi that accepts two inputs, 1) being a ref to vi to call/run and 2) some data to pass to the called vi

I would like to be able to design a genric vi that will accept any data type including arrays, structures etc

I of course would then have to be able to get hold and use the data in the called vi.

Polymorphism springs to mind but I don't know what types of data I need so this is not possible.

Can anybody help ?

Cheers

Steve
0 Kudos
Message 1 of 3
(2,859 Views)
Variant!

See
Communications >>> ActiveX >>> TO Variant

and

Variant to data

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(2,859 Views)
Hi Steve,

Thank you for contacting National Instruments.

Ben's suggestion is a great idea. I have attached an example program that illustrates how to use variants. The example does File I/O, but you can apply the same concept with the use of subVIs. In addition, the link below will take you to another post where one of my colleagues discusses how to build a polymorphic VI, in case that becomes an option for you.

http://exchange.ni.com/servlet/Redirect?id=11366374

I hope this helps!

Matthew C
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,859 Views)