LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sub vi inputs change in edit mode

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.

Jim

LV 2020
0 Kudos
Message 1 of 4
(2,573 Views)

Look into Polymorphic VIs. 

The enum would be the polymorphic instance selector.


Paul
Message 2 of 4
(2,562 Views)

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).

Jim

LV 2020
0 Kudos
Message 3 of 4
(2,546 Views)

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:

 

  1. create a polymorphic VI consisting of 1, 2 and 3 input terminals.
  2. typedef my enum for all of the 80ish functions.
  3. have each individual instance validate that the enum matches that particular VIs capabilities
  4. using the enum selector, validate the input terminal values for proper range.
Expand the description above to meet your individual needs.
-p

 


Paul
0 Kudos
Message 4 of 4
(2,525 Views)