11-16-2010 03:19 AM
I want to add a new page to the front panel of my VI. Now each time I add something to my front panel, I also need to update the clusters in all the subvi's. I know that we can update the subvi's using typedef. But I dont have a clearcut idea how to use them. I am attaching the VI also.
11-16-2010 03:30 AM
You did not include any of your subVIs.
If you make the data structure a typedef, AND use the same typedef in all the subVIs, it will get updated everywhere if you edit the typedef, e.g. to add new elements. Make the typedef a diagram constant and wire it to the top center of the bundle node. Name the elements with clear names in the typedef and change to "bundle by name" to avoid wiring errors and keep things readable.
You should really redesign your code from scratch. Once that bundle node gets even bigger, things are even less maintainable. Why do you need all these references??? This is not normal!
06-09-2015 06:32 AM
Hello all!
Sorry that i pick this thread up from the dust, but it completely hits my point.
I also wanted to control the front panel of my main VI out of different subvis. NI itself suggests to pass a reference of the control to the subvi to do the job (link). So I did it. I then decided it might be easier to create a typedef of a cluster which contains references to ALL my front panel objects and pass this cluster to all my subvis. It works just fine, but like here my code contains an ugly spot where i save all references to this cluster. So I absolutely agree that it doesn't look normal to save all these references 🙂
Is there a more clean way?
Thanks!
06-09-2015 07:39 PM