LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array size from 2-d array?

Hello all,

I am trying to read in a TDM file of some data I took a while back.  One column of data is being extracted and analyzed.  The problem is that the different columns of data have different lengths, and any time I take an array size, I just get the length of the longest channel of data, instead of the one I'm looking at. 

I attached a picture to help explain.  I indexed out the column of data that I wanted, and it has 610 values.  However, when I do an array size on it, I get 66100, which is the length of the longest column.   How can I get the size of the smaller size column of data?  I'm frustrated I can't figure this out.

Thanks!
0 Kudos
Message 1 of 4
(3,318 Views)
I never worked with the dynamic data type, and I don't have LV at the moment, but a standard 2D array has the same length for every row and column.

I'm assuming that the DDT does hold a different length of data for each channel, so you should probably extract just that channel as a 1D array. Having no experience with the DDT, I don't know how to do that, but I would look at the Channels output of that express VI.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(3,313 Views)
tst basically summarized the issue. A 2D array has the same number of elements for each row/column. When you convert the dynamic data to a 2D array, that's what you'll get. Based solely on the screenshot you provided, and not having access to the actual data you have, it seems that you're saying the answer should be 610 because the values beyond index 610 are zero. Thus, to get the array size, you could simply use Search 1D Array to find out where the first zero occurs. This, of course, assumes, you don't have a zero someplace else.

An alternative is to use the Select Signals Express VI that will let you pick out the signal you want. Then a Convert From Dynamic Data should give you a 1D array.
0 Kudos
Message 3 of 4
(3,296 Views)
That works great, thanks!


0 Kudos
Message 4 of 4
(3,282 Views)