LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting a sub array from a 2D array

Solved!
Go to solution

I've been beating my head against the wall on this issue for a while now and ran out of ideas so I'm asking for some help in any way.

 

What I want is pretty simple:

A way to take a 2D array with time and temperature (the temp. is from a thermocouple so there is a small amount of noise) and find out when the array first crosses a certain point and start gathering data. After that I would like to stop gathering data in this way with a cutoff point. The trick is, is that I would like to keep the values of all of the data in this sub array untouched and be able to match up the time with the temperature data identical to the original 2D array.

All of the methods I've tried remove data points so that they don't align with the original. I've tried using the Signal Triggering Express VI and that gives me what I need but the problem is that I'm having trouble getting that triggered signal unto a 2D array with time temp. Also I should say that this data is getting sent to an xls. file via ActiveX, which as far as I know only accepts the array format.

 

My last try I think is the closest I've gotten to getting what I want so I've attached it in the hopes that it helps you help me but if its totally wrong feel free to dent my pride and suggest another approach. 

 

Any help would be great,

 

Neill

0 Kudos
Message 1 of 8
(7,226 Views)

Please add some typical data to the input array and other controls, make the current values the default, then save it again before attaching.

Then let us know what the reuslt should be.

0 Kudos
Message 2 of 8
(7,214 Views)

If I understand the problem right, you could try something like this.

 

Download All
0 Kudos
Message 3 of 8
(7,212 Views)

Thanks for responding altenbach,

 

I've tried your solution and it seems to only look at the array once and then stop. I believe that the problem is with the  threshold 1D array VI. One of my previous attempts at this problems involved using these tools and it didn't work because of the fact that they can only use non deciding data, which wont work with the data that I use.

 

I've ran a test and (hopefully) saved the data to the array as a default so that you'll be able to run it with data that I would normally be using.

 

I don't know if its worth anything but I think that the key to this problem is to run the array through a For loop and use a feedback node with a OR gate and filter the values above the upper limit and then do the same thing and filter out the values below the lower limit. It seems like it should work in theory but for some reason some temperature data is being removed from the array when it shouldn't be and I can't quite puzzle it out yet.

 

I hope this makes the problem clearer for you,

 

Neill

0 Kudos
Message 4 of 8
(7,178 Views)

@NeillB wrote:

... and it didn't work because of the fact that they can only use non deciding data, which wont work with the data that I use.


I have no idea what that sentence means. What is "non deciding data"???

 

Your code makes absolutely no sense. Why do you constantly change dimensionality?

To extract the two first rows, all you need is an index array resized to two outputs. You can trim to the desired number of cycles using "array subset".

0 Kudos
Message 5 of 8
(7,164 Views)

Why is the default for the number of cycles 2000. Nothing interesting happens for the first 2000 points. Don't you simply want to operate on the full array?

 

You did not set default values for the "limits". What should they be?

 

In what way does my VI not work? Have you tried it?

Since your data is decreasing, you need to analuyze from the back, but the rest remains basically the same.

SInce you have columns instead of rows, you need to index in the other dimension.

0 Kudos
Message 6 of 8
(7,159 Views)
Solution
Accepted by topic author NeillB

OK, I understand now what you mean. Your "non deciding" should actually read "non descending". 😄

 

All you probably need is negate the data for the thresholding and negate and swap the limits. Now it seems to work just fine.

 

Download All
Message 7 of 8
(7,152 Views)

You sir, are a champ!

 

That works exactly how I wanted it to. Thank you very much!

 

And I'm blaming the spell check, and the fact that it was early in the morning, pre-coffee, for the spelling blunder.

 

Thanks again,

 

Neill

0 Kudos
Message 8 of 8
(7,143 Views)