01-10-2006 07:53 PM
01-10-2006 08:31 PM
01-10-2006 08:40 PM
01-11-2006 03:08 AM
Hi,
I had also similarly group indicator references into cluster. I did try to avoid using too many indicator by using for example list boxes when amount of data is huge. else you could also group similar data into array first before grouping them together with cluster. By using a event structure in the main VI, you can control when and where things happen.
Hope that helps.
Goy
01-11-2006 07:04 AM
01-11-2006 02:44 PM
Thanks so much for your tips.
I think i figured out some interesting solutions that dont involve using lots of wires and creating lots of clutter.
I decided to Functional Global the referance to the Main VI. From that I can change the values with the invoke node. If I need to actually get a referance to a front panel object, I am using the Main VI referance, some property nodes, and the name of the Object (Label) to get a referance to that object. I am in the process of re-working the code I broke to switch to this method - but learning this now will save me hours (days) later when I have to write my next app.
Thanks again,
Kevan -
01-11-2006 03:05 PM
Hi Kevan,
The method you plan on employing will save on diagram space, but as your UI expands, the code you have that will be iterating through the panel objects trying to do label matching in order to get/set properties will become slower and slower. The only "clutter" in the method I described is the large Bundle By Name that takes place during initialization of my main UI, and that code is off to the far left in my main UI diagram and doesn't get in the way. Also, the method you describe is rather fragile in that, if you decide to rename any front panel controls, you'll always have to search your diagrams for places where you reference that control via its label so your VIs won't break.
I've always found reference passing via a typedef cluster to be the most robust way to handle UI manipulation in my main app diagram and in subVIs. It requires a little more work up front to construct the control reference typedef cluster, but I guarantee it's faster in the long run, both for program execution and maintenance time.
-D
01-12-2006 08:03 AM
02-22-2006 08:30 PM
Hi Darren
I read about your approach and wanted to try it out. Can you please provide a small sample program of how you add control references to the cluster. I was having problems in creating the cluster without actually placing the control inside it.
Thanks
Zulfi
02-23-2006 10:20 AM
Hi Zulfi,
Here's what you do. Create a strict typedef cluster. Drop control references into it. Change the type and label of those control references to match the control references you will be wiring in on your main VI diagram. Save the typedef. Now in your main VI, in the initialization section of your code (which should be the far left of your diagram), drop a Bundle By Name function. Now drop a dummy copy of the strict typedef cluster on your panel and hide it. Wire this control terminal to the middle terminal of your Bundle By Name. Now wire the control references into each input of the Bundle By Name. Now the output cluster wire of the Bundle By Name contains all your control references. You can then use this wire anywhere on your diagram to unbundle control references when you need them with the Unbundle By Name function. If you want to do this in a subVI, just create an input on the subVI that is the strict typedef cluster, wire in the afore-mentioned wire to this terminal, and use the Unbundle By Name function inside the subVI to get whatever references you need.