LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic connection of sub-vi's terminals

Hello,
I'm looking for a way to have dynamic sub-vi blocks (not using Express Vi). My purpose is to force some inputs or outputs of a subvi unconnectable over certain conditions. Is it possible?

Many thanks in advance for your help!

Neon
0 Kudos
Message 1 of 6
(2,563 Views)
Neona,
I am not sure about what you are willing to do?
Can you make a simple example of what you need so that we can help you?
Regards,

AlessioD
National Instruments
0 Kudos
Message 2 of 6
(2,536 Views)
Hallo AlessioD,
I'll explain better my problem with an example.

Look at the attached vis.
Ex1.vi, as subvi, has 3 inputs (Input1, Input2, Input3)
I put this vi in my function palette, to use it several times.
Launching my labview program, the user can select for example the type of a measurement(1, 2 or 3), let's say (1). After this point my program gives the possibility to the user to edit a sort of "cycle measurement" using labview language. Three different examples of "cycle measurement" are visible on main.vi. The measurement type 1 uses only the input1 the other 2 inputs in this case have no meaning and they can cause confusion. For the type 2 the unique meaningful input is Input2 and the same for input3. So my question is: Can I hide to the user some of the inputs of a subvi depending of my initial choice without using 3 differents subvi's one for each type of measure.

I hope that my question will be enough clear.
Many thanks for your help

Best Regards
Neon
0 Kudos
Message 3 of 6
(2,514 Views)
Hi,

I believe the answer to your question is Polymorphic VIs.
To get started with developing Polymorphic VIs you should check out this web page:

Polymorphic VIs

Regards,
AlessioD
National Instruments
0 Kudos
Message 4 of 6
(2,510 Views)
What I don't understand is:

It sounds like each measurement type only uses one of your "extra" 3 connectors. Why don't you just have two terminals, one to choose the measurement type and one to pass the extra data.

You can use a case structure in the sub-vi to make the data of the second connector available to the appropriate piece of code.

If this isn't viable because you have three different datatypes, then it almost sounds like you either need to unify the data types for your different measurements and use a single input or go with polymorphic VIs.

Using a polymorphic VI you can automatically choose which code gets executed depending on the data type connected. This way, you will actually only need one terminal, as the data type connected will automatically determine whether measurement 1, 2 or 3 is to be executed.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 6
(2,506 Views)
Many thanks, for your help.
I think that my solution is on Polymorfic VI's world.

Best Regards
Neon
0 Kudos
Message 6 of 6
(2,493 Views)