LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array manipulation (remove rows that are > rows after them)

Solved!
Go to solution

I have an input array that I am looking to manipulate. 

 

We are measuring a torque device.  In the measurement sequence we want to display the data on a continuously rising slope, though when we let off the acceleration of our moving device at the end of the test we end up with higher torque #s at the beginning of the RPM sequence ... which blurs our slope line on our graph.

 

For example, see the attached PNG on the torque/rpm array.  I need to be able to cut out the first 2 rows of the array as we need to go from least to greatest in the torque row sequence.  Throughout the test we may have a torque number in row 10 for example that is greater than the torque value in row 11, thus we would need to cut out the torque value in row 10. 

 

I've attached the sub vi that I've wired in order to attempt this, but cannot get it to work.   I am not looking to sort the array, but to remove the rows that are greater than the rows after them ... with respect to the RPM value consistently decreasing.  If I have a pair value of 2340/1869 in row 1 & 276/1839 in row 2, I need row 1 removed.  But if I have a pair value of 2509/1704 in row 12 & a pair value of 2493/1689 in row 13, I'd want to leave that torque value in (if possible) as it is a realistic aspect of the torque curve captured throughout the power sweep of the test.

 

Any ideas?

 

 

Download All
0 Kudos
Message 1 of 8
(2,579 Views)

It likely won't get you all the way there, but you could use Array Subset with your Array Max & Min to have your array start at the min value.  It will get you there with the specific data you have given.

I used the Min Index to tell the subarray where to start and left the length unwired so it would default to the rest of the array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(2,559 Views)

Basically, loop through all rows and compare them to the _previous_ and if it's at most 5% bigger (e.g.) add it to a resulting array, else skip it.

The result should be a cleaned array.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 8
(2,546 Views)

Since it seems we are looking for the linear portion of the plot, could we not treat it similarly to a gain plot and compare the ratio of x to y and when it reaches a point where it starts moving away from 1:1 (your call where exactly that is), that's where our cutoff point is?

 

[edit]

well, that's not exactly right, but you get the picture

[/edit]

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 8
(2,538 Views)
0 Kudos
Message 5 of 8
(2,529 Views)

could you post this code in LV 2011.... thank you for the help.

0 Kudos
Message 6 of 8
(2,512 Views)
Solution
Accepted by topic author jonathanupr
0 Kudos
Message 7 of 8
(2,503 Views)

thank you for the VI.  This will do the job Smiley Happy

0 Kudos
Message 8 of 8
(2,459 Views)