LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configurable input terminals with an Express VI

I am trying to develop an Express VI where the configuration dialog will determine the input terminals of the source VI.  Depending on the configuration dialog, the number of input terminals and the datatypes of the input terminals to the source VI can change.  With respect to the reconfigurable input terminals, the behavior of my Express VI would be similar to the behavior of the Build Text Express VI that is distributed with LabVIEW.

Currently, I am implementing a subset of the functionality using Connector Pane:Set with a small number of pre-determined VI's having different connector panes, but this method does not scale to handle all the combinations that could be configured by a user.


Is there a way to do what I want with Express VI's?  I would also be willing to consider something other than Express VI's if there is an alternative implementation path.

Thank you,

Stan

0 Kudos
Message 1 of 7
(3,316 Views)
Hi Stan,

You're on the right track with the Connector Pane: Set property.

The Set property configures the VI referenced by the Property Node with the same connector pane layout as the VI referenced by the input. The two VIs must have the same number of parameters, with identical data types and names. If they do not, the Property Node returns an error.  This restriction makes this property seem difficult to scale.  One way around this is to use array inputs and outputs.  This method reduces the number of iterations you must consider to the number data types you expect.  For example, instead of one string input per parameter, you could define the input to the VI as an array of strings.  What do you think about this idea?  Unfortunately, the Config code for the Build String VI is protected (of course).

0 Kudos
Message 2 of 7
(3,282 Views)

In the config page VI for your Express VI, typically on the right side of the diagram, you should see a list of terminals to grow (expand) when the user closes the config page.  This is a supported way that allows you to control which ones show up with their names in the grown part of the Express VI, as opposed to the ones that just have terminals up in the blue part at the top.  Maybe this would be sufficient for what you are trying to accomplish.  Unfortunately I don't know of a supported way to make a terminal not show up or not.

That said, most of the shipping Express VIs' config pages are actually not password protected.  Some are admittedly not the cleanest pieces of code I've ever seen, and several are fairly old (user-interface VIs that were written before the event structure existed), but if you find one that does something you want to do, you could try opening its config page VI and looking at the diagram to see if you can find the right piece of code and attempt to do the same thing.  You will find, however, that quite a few of the subVIs on the diagram of the config page VIs are password-protected and undocumented.  This is why I say this functionality is "unsupported".

0 Kudos
Message 3 of 7
(3,267 Views)
Jeff and Steve,
 
I am using Terminals to Grow to control the terminals that show up in the grown part of the Express VI.  I don't need to control the terminals in the blue part at the top.  However, I need to control the types (e.g., int32, double, bool) of the terminals in the grown part, since the types of the grown terminals will be selected at design time in the configuration dialog for the Express VI (similar to the Build Text Express VI).  It is possible to control the types of the grown terminals by using Connector Pane:Set, but then a separate VI (connector pane) for every possible combination of types would have to be defined.  The number of combinations I need to handle makes this direct approach impractical; for example, handling 10 parameters with 3 possible types using the Connector Pane:Set approach would require defining 3^10 VI's (connector panes).  It is this problem of controlling the types of the grown terminals that I am trying to solve.
 
I want to use supported/documented capabilities of LabVIEW or capabilities that can be licensed.
 
Thank you,
Stan
0 Kudos
Message 4 of 7
(3,251 Views)
Hi Stan,

With three data types, you would need eight parent VIs if you used array inputs instead of single data elements.  Not the prettiest implementation, but better than 3^10 parent VIs.
0 Kudos
Message 5 of 7
(3,240 Views)

Steve,

Thanks for the array suggestion, but I don't want to require that the intended users of my Express VI have to know about array types.

Stan

0 Kudos
Message 6 of 7
(3,221 Views)
Hello Stan,
 
In short, unfortunately the framework provided by the Express VI Development Toolkit was not designed to provide the functionality you are trying to achieve.
 
If you can create a connector pane with the superset of all types for all inputs then you could grow only the ones you need for a specific case, and leave the rest in the blue part at the top.  They would still be wireable, but they would be de-emphasized.  It sounds like you have more than 28 types though, so this may not work.
 
Another possible option would be to use the Dynamic Datatype for your inputs, provided all the types you want to support can be represented by the DDT.  This is the type that most shipping Express VIs use, and it can support a boolean, 1D & 2D array of booleans, numeric, 1D & 2D array of numerics, waveform, and 1D array of waveforms.
 
Hope this helps!
Jeff
0 Kudos
Message 7 of 7
(3,203 Views)