From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi vector or matrix input and output

When I use a subvi when an input or output are vectors or 2d matrices I have to make 2 subvis: one that works with matrix and another with vectors. It is possible that a subvi input and output that can be either 1D or 2d?

As can be in the image, in the 2D version, input and output matrices are used and in the lower part vectors are used. The operators are the same but when I use the 2D version and I introduce vectors instead of 2d matrices it does not work:

 

subvi vector or matrix input and output.png

0 Kudos
Message 1 of 2
(2,244 Views)

Yes, look up "Polymorphic VIs".

 

Polymorphic VIs are VIs that can adapt depending on what is wired to them. If you've ever seen a VI with a drop-down box underneath it, that's a polymorphic VI and they are relatively easy to create once you have the different intances.

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/using_polymorphic_vis/


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 2
(2,230 Views)