08-16-2007 07:10 PM
08-16-2007 09:26 PM
You can not increase the number of terminals but you should cluster the data into groups of common themes. In software ingineering you should keep your functions simple, so if you need more than 10-12 input/outpous you should consider refactoring the function into several smaller subfunctions. This will make your core easier to manage read maintain and reuse. I have found out this over the last 10+ years of coding that simpler is better.
Paul
08-17-2007 02:19 AM
08-17-2007 07:03 PM
08-17-2007 07:38 PM
08-17-2007 07:42 PM
08-17-2007 08:10 PM
@resrchengee wrote:
I have two sets of vi's which do the same thing and the one for which I build an array and then send the array in requires approximately 200 kb than the case where I send in three inputs.
You are kidding, right? The difference is more like 200bytes (0.2kb). Why do you think an array with e.g. 3 elements will take significantly more memory than 3 individual scalars.
Memory considerations are important once it gets into the tens of MB.
Once you have a million numbers, I dare you to use individual scalars instead of arrays! 😄
(Your thinking is like the idea of clipping toenails to significantly loose weight. 🐵
Much more important is your overuse of property nodes. They really cost you a performance penalty. Why do you need all these references? Why do you need a subVI to update a few controls? A better idea would be to use an array of controls, requiring only a single reference. (Or no reference at all if you would make the array an indicator and use a plain output connector from the subVI. No more references needed!)
08-18-2007 11:21 AM
08-18-2007 11:45 AM
08-18-2007 12:11 PM
@resrchengee wrote:
Why do I need references? I need them because I need to be able to change control values and indicators from within a sub vi. If there is another way to do that without having the references please explain?
I certainly don't know the final purpose of your VI and what else will be there. There are always many different ways to do things and my comment simply meant that there might be other options.
To simply change a value of a control does NOT even need a subVI, especially since you seems to be so overly concerned about memory use and performance.
Maybe you can explain to all of us what you are really trying to do and why you think references are the best way. I have written thousands of programs and never updated controls that way, and never had the need to do so. 🙂
(And looping through control references by name as suggested by Stradis seems to just complicate things even more. I would always strive for the simplest solution! :))