LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array - trigger events

Solved!
Go to solution

Hi,

I have a tricky problem: I would like to filter values which aren't in range of a two values e.g. max 400 min -200.

The evaluation unit shell filter the first index and the last index of the exceeding. I've attached a screenshot of my current
source code but my problem is, that if on the exceeding was found e.g. at index 1,2,3,4,6,7,8,50,51,63 - the algorithm should find
the max value from index 1-4, 6-8,50-51 and 63. When only one value was found the start index is also the end index. To easily find the event I want to also log a digital ramp from start to end index.

The problem of my attached source is that only one event per unit will be found. Has anybody a hint?

Thanks in advance.

Best Regards,
--
Joachim

 

0 Kudos
Message 1 of 10
(3,836 Views)

If you want multiple results, you simply need to use a loop to find them all.

 

Can you attach an actual VI and some typical data instead of a picture?

0 Kudos
Message 2 of 10
(3,824 Views)

The loop isn't the problem but the algorithm inside the loop: I have to compare the values in that array - element per element. I've attached a vi with demo data. The result should be an array of cluster with the max value+timestamp, start timestamp and stop timestamp.

 

Best Regards,

 

--

Joachim

0 Kudos
Message 3 of 10
(3,781 Views)

hi,

 

is the demo enough? hasn't somebody an hint for me how to solve the problem?

 

Best Regards,

 

-- 

Joachim

 

0 Kudos
Message 4 of 10
(3,711 Views)

There are many ways to solve this, here's one simple possibility. (Just a draft, please check for bugs).

 

I replaced the timestamps with an integer ramp for easier debugging. Simply replace the integers with timestamps again.

 

(connect the timestamp array instead of the blue array to the loop and replace my clusters with your typedef again.)

Message Edited by altenbach on 01-07-2010 05:37 PM
Message 5 of 10
(3,696 Views)

Altenbach,

 

thanks for your help. It's great. One problem remains: if the value is negative (-400,-500,-600) the max value is the lowest one --> -400.

 

Best Regards,

 

-- 

Joachim

0 Kudos
Message 6 of 10
(3,682 Views)

Joachim082 wrote:

thanks for your help. It's great. One problem remains: if the value is negative (-400,-500,-600) the max value is the lowest one --> -400.


-400 is the largest of (-400,-500,-600) and thus the max! Right?

 

What else do you expect? 🙂

0 Kudos
Message 7 of 10
(3,675 Views)

Altenbach,

 

no - in the negative range -600 is the max value. The unit is kNm. I need the maximum value of the amplitude.

0 Kudos
Message 8 of 10
(3,663 Views)
Solution
Accepted by topic author Joachim082

Joachim082 wrote:

no - in the negative range -600 is the max value. The unit is kNm. I need the maximum value of the amplitude.


No, it's not. I guess you want the largest absolute value, which is not the same as the plain max.

 

This also leads to more questions. For example if a range contains -290 and 280, which one would be the max???

 

 

Here's a quick trivial modification to the existing code that keeps the value with the largest absolute value for each subrange. See if this works for you. 😉

Message 9 of 10
(3,657 Views)

altenbach,

 

a range from -290 to 280 is impossible. I've always values between which aren't out of the min-max range. E.g. one trend could be 400,280,240,200,100,0,-120,-250,-300,0 -->  min: -200 max: 250 --> 1. cluster element: {400,280; max: 280} 2. cluster element: {-250-300; max: -300}. This should be the result. I need the leading edges.

 

I will test the modified vi.

 

Thanks.

0 Kudos
Message 10 of 10
(3,653 Views)