09-04-2012 08:55 AM
Greetings,
I am going through some exercises to learn LabView and I have a question.
One of the exercises in my book is to create a subVI that generates a random number within a min/max range. (OK--re-invent the wheel) I have the block diagram and I have the icon designed, but I am having difficulty in getting the connections wired.
Right now it's a hard-coded static value for the min and max. I'd like to have a connector in for each of the min and max (so that the parent can specify that however it wants be it with a static integer, an input, etc) and then a connector for the output--again, without a specified control so that the parent can take the value and run with it.
How do I do the wiring? I can obviously drop in controls into the front panel, but my parent project doesn't need the clutter of 3 extra controls coming up on it.
Thank you,
newbo
Solved! Go to Solution.
09-04-2012 09:02 AM
In the top right hand corner of the window, next to the icon is the connector pane.
This is where you associate controls or indicators with connections on a sub-vi.
http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/building_connector_pane/
09-04-2012 09:06 AM
From the connector pane, you can right-click on a connector and select a setting. You can set "This Connection is->" to Recommended or Optional. This will allow the VI to be called without those terminals wired from the parent VI. If left unwired, the default values you put in the controls will be used.
09-04-2012 09:37 AM
If you don't want the clutter of three controls then you are thinking along the right lines. Create a cluster control and make sure you save it as a type-def.