Choosing between Malleable VIs and Polymorphic VIs

LabVIEW 2018 Help

Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)

LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

You can use a malleable VI or a polymorphic VI for different input data types. The following table compares the two types of VIs.

Aspect Malleable VIs Polymorphic VIs
Implementation A single VI that computes whether a data type is acceptable by implementation. A collection of instance VIs with a predefined set of acceptable data types.
Connector Pane The same connector pane for all data types. Different data types can have different connector panes.
Building Create a VI with the .vim file extension or convert a standard VI into a malleable VI by changing the file extension to .vim. Create an instance VI for each data type and include the instance VIs in a polymorphic VI.
Customizing Customize sections of code in the malleable VI for specific data types using the Type Specialization structure. Define different behaviors for specific data types by implementing different code in specific instance VIs.
Adapt to classes? Yes—A malleable VI that calls a method of class A accepts any class that has a public method with the same name, connector pane pattern, and terminal direction as the method of class A. No—A polymorphic VI that calls a method of class A accepts only class A or descendants of class A.

Use the following table to help you decide which type of VI to choose.

Type When to Use
Malleable VIs
  • The operation can be implemented in similar ways for different data types without significant customization for a specific data type.
  • You want the VI to adapt to input classes.
Polymorphic VIs
  • The operation must be implemented differently across data types.
  • The connector panes differ across data types.


Not Helpful