11-08-2010 01:02 PM
I am interested in making a driver VI that has dynamically changing inputs, much like some of the LabVIEW drivers such as DAQmx. When a constant is attached to the enum input terminal for the command, and a command is selected, the inputs for the command parameters automatically change to text or numeric controls as need be. Is this possible, and is there documentation on how to do it? My searches have been fruitless, but perhaps I just haven't found the proper wording.
11-08-2010 01:33 PM
Look into Polymorphic VIs.
The enum would be the polymorphic instance selector.
11-08-2010 03:33 PM
Thanks Paul, I hadn't looked at it that way. I've never made one before. I am reading about them right now. I have 80 commands, and each one has 0,1, or 2 parameters associated with it. Let's say I have command AB, and command XY. They both take 1 parameter which is a double, but the permissible values are different. Is there a way to use the same VI for each and have the control min and max values change based on the enum selection, or would I need seperate VIs? My reading so far suggests the latter, which means potentially 80 VIs (albeit small VIs).
11-09-2010 08:59 AM
because the polymorphic instance is determined at compile time (as opposed to runtime) you may want to do a combination of both methods.
Use a polymorphic VI to select the number of inputs and then an enum to validate the user inputs at the terminals.
If it were me, based on limited understanding of what you are doing, I would: