LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create a subvi that accepts scalars and/o 1D array of scalars at the same input

I am relatively new to Labview and am trying to create a subvi to convert units on a data stream.  I would like to create a subvi that would work the same with either a scalar as input or a 1D array of scalars.  How do I create a subvi that will accept either at the input and output the same form (scalar in, scalar out or 1D array in, 1D array out) at the same wiring terminal?  There is no complex math just unit conversion.
 
thanks.
0 Kudos
Message 1 of 2
(2,858 Views)
You have two options:

Option 1: Create a Polymorphic VI. This requires creating 3 VIs. One VI that handles the scalar input, one VI that handles the array input, and one VI that is the polymorphic shell. Then, in your code, you just place the polymorphic VI shell. LabVIEW will call the appropriate version based on the input. To create polymorphic VIs you need the "Professional" edition of LabVIEW. You can find detailed instructions in the online help for LabVIEW.
Option 2: Use variants as inputs.
0 Kudos
Message 2 of 2
(2,850 Views)