03-16-2012 03:43 PM
I'm looking for a good practice method of processing an array of channel data.
Let's say there is an array of 100+ channels.
The array represents the data for several boards of different types.
I want to create separate arrays for each board.
So each board sub-array would require a start index and a length.
If there is a change in the channel count on a particular board (at design time), I'd like to make the change in one place and have all of the starting indexes update appropriately.
Assume that I am not (yet) using LVOOP.
One way would be to use an action engine.
The action engine could return a start index and length for the requested board type.
That would require ten or so instances of the action engine which is OK, but not pretty.
Block diagram readability is a high priority.
Suggestions? Or other entirely different ways to deal with this type of issue?
03-19-2012 06:13 PM - edited 03-19-2012 06:13 PM
stevem181,
I'm having a little trouble visualizing what it is you're trying to accomplish.
From what I understand (and correct me if I'm wrong)...
You're producing a single, large array containing the data from a variety of channels. What you'd like to do with that array is break it into sub-arrays by indexing the start of each channel and specifying the length of data associated with that channel--thus leaving you with a sub-array for each channel. The issue you're looking to solve is how to update the indexes of each channel if you add additional channels of varying lengths somewhere in the original array, is this correct?
I'm assuming each different action engine would be associated with a board type? Could you instead build the board type selection into the action engine structure--with an enum case structure perhaps? That way you'd only have to call the one action engine in your block diagram, and the AE would allow for programmatic selection or board type.
If I'm misunderstanding your intentions, let me know. And if you have any code samples to work with, that could be helpful as well.