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 |
|
Polymorphic VIs |
|