LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing a range of data in a 1D array

I have searched this site, but have been unable to find the solution that I am looking so I am posting this hoping that someone will have an answer to my question.  I have an 1D array of 52 channels of data that I need to be able to index a range of data out of, then sum the data points and graph them.  I can sum them and graph them, but can't figure out an easy way to index the range of data out of the array and it has to be a variable range of data that is set from the front panel.  So for example say the operator wanted to see the sum of channels 10 through 30 or 15 through 42 or something similar.  What would be the best way to accomplish this in an efficient way?  Thanks in advance.
0 Kudos
Message 1 of 4
(2,620 Views)
Use the array subset in the array pallete. put your smallest number in the index and then subtract your smaller number from the bigger number and put this result in as the length input. The output will be an array starting with the smaller number and ending with your bigger number.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 4
(2,607 Views)
Though I am relatively new to labview, it seems that the easiest way is to use the "array subset" icon.   You can specify the location of the element(s) you want to start with and specify length. You input the array that you want to analyze and the indices, length, and it outputs the corresponding array.

Hope it helps
0 Kudos
Message 3 of 4
(2,606 Views)
Thanks.  Funny how I never thought of doing it that way.  I guess sometimes you need another set of eyes to look stuff over.
0 Kudos
Message 4 of 4
(2,585 Views)