LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

searching and plotting 2D array from TDMS file on intensity graph with slider

Hi,

 

I was wondering what could be the most efficient solution for my application.

 

I have a TDMS file with many groups inside. Each group has 1000 pieces of 2D arrays in it. Let's say if the 2D arrays are 50x50 then one group contains 50000[row] x 50[column] data.

Now, I would like to plot the 2D arrays using intensity graph and I'd like to select the specific array by a slider. So as I move the slider I get different 2D arrays loaded into the intensity graph.

 

That would be great if this slider could work for all the groups as well, so if I start with the slider at the beginning of the file I can scan through all the groups and 2D arrays continuously.

 

I cannot really think of a very efficient solution, my initial idea was to read the file every time from the beginning and selecting the specific 2D array with the Index Array VI but it would eat up too much CPU time...

 

Thanks,

Krivan

0 Kudos
Message 1 of 7
(3,664 Views)

Hi,

 

You can read the number of groups, channels per group, and size of the channel from the TDMS file (use the "get property" primitive) to set your sliders' min / max property.

Then depending on the slider's value load just the chunk of data you need to plot.

 

One issue might be the fact that while the slider is being moved it generates "value change" events continuously.. that can be annoying sometimes.

 

If you have trouble coding this, let me know where you're stuck.

Hope this helps

 

PS : here's how to get channel size without loading the whole data.

 

Clipboard01.jpg


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 7
(3,654 Views)

Hi Krivan,


A TDMS group cannot store 1000 pieces of 2D arrays. Technically, a TDMS file contains 1 or multiple groups and in each group, it contains 1 or multiple channels, for each channel, it can only store 1D array. So a TDMS group could store 1 2D array, instead of multiple 2D arrays, of course, a TDMS file can store multiple 2D arrays.

0 Kudos
Message 3 of 7
(3,621 Views)

Hi,

 

I got to the point where I have three sliders because I have to be able to search in a large amount of data [say there are 10 groups per measurement, that is 64 [number of channels] x 64000 [length of channels] x 10 [number of groups] ]. Teh first slider is incremented by 10 000, the second by 1000 and the third one by 100 that is in the attached picture.

 

Now I move the first and second slider and I select the requested 2D array page by the third one. As it is coded now I would assume that it takes one 64x64 large 2D array and it would be sent to the intensity graph. If I run the VI and generate the mouse down event on slider 3 basically nothing appears in the intensity graph. 

 

I step-by-step debugged the and the read VI seemingly outputs a 64x0 matrix instead of 64x64. What am I doing wrong?

0 Kudos
Message 4 of 7
(3,568 Views)

I think you need to specify the group name and the channel name.

 


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 5 of 7
(3,559 Views)

Hi,

 

yes but that's the point, if I provided the group names I would exactly know where I am in the file but I do not. So I select the appropriate 2D array with the sliders and I would like to pick only that specific one. I guess it would be possible to find it putting the TDMS Read into a for loop and search for it but if I searched for 2D array this way many times, say I wanna see 10 2D arrays next to each other, it would be slow and would need too much computation.

0 Kudos
Message 6 of 7
(3,547 Views)

The problem has been solved. Yepp you were right, I just calculated the group name and then still had to modify the max number of elements of slider 1 because it pointed actually outside of the file...

Thanks for your suggestion!

0 Kudos
Message 7 of 7
(3,543 Views)