LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a drop down menu to a subvi as an intput terminal

Is it possible to add a drop down menu as an input to a subvi? For example, when using the "Build Waveform Function", when you pass your cursor over the block, a little finger appears that allows you to select which input you are passing to the block. This seems as though it should be straigh forward. My subvi contains a case structure with multiple states. I would like to be able to easily selct the functionaluty without having to go back and see which input value goes with which state. I would like to be able to just click and point to select the proper input.

0 Kudos
Message 1 of 7
(3,118 Views)

Look into using a Ring Constant or a Enum Constant.

They are located on the Numeric Palatte. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 2 of 7
(3,117 Views)

It is almost sounding like what you really want is a polymorphic VI.


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
0 Kudos
Message 3 of 7
(3,103 Views)

Similar to a ploymorphic vi, but it is only a single vi with multiple functionailities, each of which is determined by a single input. I would like to be able select that input value from a drop down menu that will pass the appropriate value to the subvi.

0 Kudos
Message 4 of 7
(3,092 Views)

This is the simplicity I am lookig for, but is it possible to make a ring constant a permenant input on a subvi. Currently, I have to create a new ring constant and connect it every time I place the subvi on the block diagram. I would like to be able to place the subvi in the block diagram with the ring constant already available.

0 Kudos
Message 5 of 7
(3,087 Views)

@johnmountney wrote:

This is the simplicity I am lookig for, but is it possible to make a ring constant a permenant input on a subvi. Currently, I have to create a new ring constant and connect it every time I place the subvi on the block diagram. I would like to be able to place the subvi in the block diagram with the ring constant already available.


You can make a wrapper VI and put it in your function palette and make it as "Place VI Contents".

Or you could use scripting to create a plugin.

 

The Right-Click->Create Constant isn't that bad.  I normally just copy and paste or Control+Drag to do what you want.


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
0 Kudos
Message 6 of 7
(3,079 Views)

Make sure to make that ring constant terminal as "Required".

0 Kudos
Message 7 of 7
(3,049 Views)