06-21-2013 01:05 PM
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.
06-21-2013 01:07 PM - edited 06-21-2013 01:09 PM
Look into using a Ring Constant or a Enum Constant.
They are located on the Numeric Palatte.
06-21-2013 01:48 PM - edited 06-21-2013 01:48 PM
It is almost sounding like what you really want is a polymorphic VI.
06-21-2013 02:02 PM
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.
06-21-2013 02:24 PM
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.
06-21-2013 02:37 PM
@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.
06-21-2013 03:45 PM
Make sure to make that ring constant terminal as "Required".