LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Max value dilemma

I´m in desperate need of some help.

I have an analog input and I need to pick out the maximum value with �array min/max�.
The signal remaines zero from t0 to t1, then it goes positiv (up and down in more or less a radom way) from t1 to t2 and then down to zero again from t2 to t3(and so on..). The problem is that you can´t predict how long each time interval will be.
What do I do to put those positiv values in an array, send them through �array min/max.vi� to get the max-value, when I dont now:

1) when the signal turns positiv
2) how long it will stay positiv
3) how long the �zero intervals are

Please help me.
0 Kudos
Message 1 of 6
(3,469 Views)
Measure in a while loop with a shift register initialized with a zero. Then
for every measure use the max and min function (not array max-min) to see
whether the measure or shift register is larger and put that result back in
the shift register. That way you have a constantly updating largest value
output.


"Dawe" wrote in message
news:506500000008000000D95C0000-1031838699000@exchange.ni.com...
I´m in desperate need of some help.

I have an analog input and I need to pick out the maximum value with
"array min/max".
The signal remaines zero from t0 to t1, then it goes positiv (up and
down in more or less a radom way) from t1 to t2 and then down to zero
again from t2 to t3(and so on..). The p
roblem is that you can´t
predict how long each time interval will be.
What do I do to put those positiv values in an array, send them
through "array min/max.vi" to get the max-value, when I dont now:

1) when the signal turns positiv
2) how long it will stay positiv
3) how long the "zero intervals are

Please help me.
0 Kudos
Message 2 of 6
(3,469 Views)
Thanks for the tip Adam, it seems to be an easy way of doing it.
How ever, as soon as the "measurement value" goes back to zero I need to reset the shift register so that I can take out the max value the NEXT time it goes positiv, and so on. How do I do that?
0 Kudos
Message 3 of 6
(3,469 Views)
It just hit me, I can´t do like that Adam. If I use the max-min function like you say, I`ll get a new max every time the measurement value is larger than the last one. I`m in need of getting just THAT one maximum. Thats why I need to use the array max/min.
Any suggestions?
0 Kudos
Message 4 of 6
(3,469 Views)
Ok I think you need to collect the high point for every event.
Build the while loop like I wrote. Pull down on the input shift register.
That gives you the value in the preceding iteration (need to initialize
both). This way you can end the while loop when current loop's shift
register is zero and previous is >0. Now the while loop ends after every
excursion event and the output is the high value for that event. Then put
another while loop around it to collect all the events results.

"Dawe" wrote in message
news:50650000000500000079A20000-1031838699000@exchange.ni.com...
It just hit me, I can´t do like that Adam. If I use the max-min
function like you say, I`ll get a new max every time the measurement
value is larger than the
last one. I`m in need of getting just THAT
one maximum. Thats why I need to use the array max/min.
Any suggestions?
0 Kudos
Message 5 of 6
(3,469 Views)
OOP. Not quite right. You dont need the pulled down shift register. Just
end the while loop when the current measure is zero and the shift register
is >0.

"Adam Russell" wrote in message
news:3d8df88b@newsgroups....
> Ok I think you need to collect the high point for every event.
> Build the while loop like I wrote. Pull down on the input shift register.
> That gives you the value in the preceding iteration (need to initialize
> both). This way you can end the while loop when current loop's shift
> register is zero and previous is >0. Now the while loop ends after every
> excursion event and the output is the high value for that event. Then put
> another while loop around it to collect all the
events results.
>
> "Dawe" wrote in message
> news:50650000000500000079A20000-1031838699000@exchange.ni.com...
> It just hit me, I can´t do like that Adam. If I use the max-min
> function like you say, I`ll get a new max every time the measurement
> value is larger than the last one. I`m in need of getting just THAT
> one maximum. Thats why I need to use the array max/min.
> Any suggestions?
>
>
0 Kudos
Message 6 of 6
(3,469 Views)