LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying a maximum value

Solved!
Go to solution

I'm not sure how to go about this, but I need to get the maximum value from (location1), put it in (Max Temp1) and have it remembered for the duration of the VI run time.

 

My VI is attached.

 

Thank youMaxTemp.PNG

0 Kudos
Message 1 of 15
(3,331 Views)

You need some logic inside your loop:

IF current value > highest value

THEN highest value = current value

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 15
(3,325 Views)

something like this...

 

grfs.png

 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 15
(3,320 Views)

Thanks 

 

0 Kudos
Message 4 of 15
(3,313 Views)

Indicators that should update during the loop, need to be inside the loop.

 

All you need is array min&max ptbypt. No need for shift registers or logic.

 

array_max_min_ptbypt

Leave the sample length unwired to get the cumulative solution. Wire the init terminal to [i] via an "=0" primitive to reset the max whenever the loop is entered again on the next run if that is desired..

0 Kudos
Message 5 of 15
(3,311 Views)

@LabNoob14 wrote:

Thanks 

 


 

Yes use the "BGColor" property node for the indicator you want to change and the color box constant, and of course some logic to determine when to change the color

cbCapture.PNG

========================
=== Engineer Ambiguously ===
========================
Message 6 of 15
(3,303 Views)

@LabNoob14 wrote:

Thanks 

 


Be careful, because it will fail whenever the temperatures start out and remain negative. It would incorrectly show a max=0. The shift register needs to be initialized with "-inf", not with zero!

 

My solution above is probably easier.

 


@LabNoob14 wrote:

 


The color is just a property that you can set via property nodes (unless you use indicators from the system palette). Write the new property when the color needs to change, and not over and over with the same value, of course.

 

 

 

0 Kudos
Message 7 of 15
(3,299 Views)
Solution
Accepted by crossrulz

... and if you don't want to use the ptbypt VI for some reason, here's another simple way. Less code!

 

maximilian.png

Message 8 of 15
(3,289 Views)

@altenbach wrote:

... and if you don't want to use the ptbypt VI for some reason, here's another simple way. Less code!

 

maximilian.png


Hey, that's slick I never would have thought of that.

========================
=== Engineer Ambiguously ===
========================
Message 9 of 15
(3,277 Views)

I don't think I have that array min&max in my version of LV 2014.

The closest thing I could find is this

arrayminmax.PNG

0 Kudos
Message 10 of 15
(3,273 Views)