LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modify control behavior in sub-vi

I'm using a dual-slide control in several places to select a range of values. I've added behavior to the slider by forcing the value of the second slider to be greater than or equal to the first slider. I'm doing the limit calculations in a sub-vi by threading the control values through the vi. It all works fine but I've been trying to find a way to add the behavior in the Sub-VI without having to pass it back to the main. In other words, I want to add a control to a panel that has the appropriate behavior without adding the necessary code to the main diagram. I can imagine this being done by passing say a reference to the control to an appropriate sub-vi which then monitors the control and performs whatever limiting is necessary without having to wire it back to the calling VI.

There are other instances where you want to customize control behavior so I'd like to see a better way to handle this. I've tried working with contol references but to no avail.
0 Kudos
Message 1 of 3
(2,327 Views)
Using a reference should be the answer. What was your problem with them?
Right click the terminal and select Create>>Reference, then right click the reference and select Create>>Control. Copy this control (the reference) to the subVI and have it as part of the connector pane. On the BD, wire its terminal into a property node. Since you created it from a specific control, it should give you all the properties of that control. Place the subVI on your BD and wire the reference from the original control into it and it should work. If it doesn't, I suggest you post the code.

___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,318 Views)
OK. Thanks for the reply and I now do get the behavior I want.
I had tried something similar using a control reference then, selecting the reference, Edit->Create SubVI which gets you to the same point. But then I tried right clicking on the slider reference in the subVI to create a property node. But that property node does not work. However if I drop an ApplicationControl/PropertyNode onto the diagram and link it to the reference, then I can select an appropriate value and get the desired behavior. Both elements are called property nodes but look and behave differently.

Now that the control modifier is nicely contained I feel free to refine the behavior as much as I want and let it operate. Enclosed is my working example..


Thanks again
Rob
0 Kudos
Message 3 of 3
(2,300 Views)