07-21-2011
12:24 PM
- last edited on
11-12-2024
08:35 AM
by
Content Cleaner
I have been searching for the best method to create highly expandible code for control and acquisition of an large experiment (60+ data channels) but I haven't yet found anything that I thought was sufficient. I suspect many people have this concern, so I wanted to see what other solutions are out there.
Obviously, object oriented programming is a great help to creating expandable code (Object Oriented Video). I'm still unsure of how to structure the objects however.
I tried working with arrays and clusters with limited success. The solution I'm playing with right now is a Name Referenced Array (see attached). It is a cluster containing an array of type defined enums, called "Name" and an array of values. The type definition of the "Name" enum contains one value for each array in the element you want. To initialize, you loop through each possible value of the enum and initialize a corresponding array index to default. Now you have a corresponding value for each item in the enum. You can write a member VI that takes the new value and "Name" type defined enum and writes the value to the correct element of the array.
This has made it very easy to apply the same process to a large amount of data (particularly with child data traveling on parent wires) and the code is as readable and self updating as clusters. The Name Referenced Array can only carry one data type however, unlike clusters (this could be mitigated by using a Name Referenced Array of objects or clusters).
What other techniques exist for large, maintainable, expandible programs? I can't be the first person to worry about this. Thanks for any advice.
07-21-2011
12:31 PM
- last edited on
11-12-2024
08:36 AM
by
Content Cleaner
Check out this: http://www.ni.com/largeapps/