LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI with a variable data type terminal

Solved!
Go to solution

Hi,

 

I want to create a subvi with a terminal that can be used to define a data type. In a similar way, for example, as the Create Network Stream Writer Endpoint has a data type input.

 

network stream writer endpoint.png

 

 

 

 

 

 

The only thing I found so far that seems related are malleable vi's, is this a use case for that?

Could anybody point me in the right direction on how to implement this?

thx.

0 Kudos
Message 1 of 4
(192 Views)

Start reading here.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 2 of 4
(159 Views)
Solution
Accepted by topic author sopapo

@sopapo wrote:

The only thing I found so far that seems related are malleable vi's, is this a use case for that?

 


Yes.

 

Altenbach's link is one way to go, but if you prefer a video there's this presentation from NI week that does a pretty good job too.  It's a bit blurry on the screen but all of the code examples used are in the LabVIEW "examples" folder that installs with anything from LabVIEW 2017 and later, so if you just open them and follow along it should be fine.

Message 3 of 4
(155 Views)

Just for completeness, your other option is a polymorphic VI.

 

Malleable VI:

  • 1 VI to maintain
  • All connections are adapt to type, which can lead to confusion

 

Polymorphic VI:

  • Need a VI for each data type you want to support
  • Can choose which implementation to call based on what is wired, therefore better defining inputs whose type should not change.

I actually have one setup where I have a Malleable VI that is used as the core for several instances of a Polymorphic VI.  Don't try to think about it too much.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(149 Views)