06-25-2018 02:54 PM
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 you
Solved! Go to Solution.
06-25-2018 03:13 PM - edited 06-25-2018 03:14 PM
You need some logic inside your loop:
IF current value > highest value
THEN highest value = current value
06-25-2018 03:21 PM - edited 06-25-2018 03:23 PM
something like this...
06-25-2018 03:43 PM
Thanks RTSLVU that works good.
Do you know if it's possible to change the color of the indicator boxes dynamically?
Say 30 is blue and 200 is red. Is LV capable of this kind of thing that would be simple in excel...
06-25-2018 03:46 PM
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.
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..
06-25-2018 03:49 PM - edited 06-25-2018 03:52 PM
@LabNoob14 wrote:
Thanks RTSLVU that works good.
Do you know if it's possible to change the color of the indicator boxes dynamically?
Say 30 is blue and 200 is red. Is LV capable of this kind of thing that would be simple in excel...
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
06-25-2018 03:51 PM
@LabNoob14 wrote:
Thanks RTSLVU that works good.
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:
Do you know if it's possible to change the color of the indicator boxes dynamically?
Say 30 is blue and 200 is red. Is LV capable of this kind of thing that would be simple in excel...
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.
06-25-2018 03:56 PM - edited 06-25-2018 03:56 PM
... and if you don't want to use the ptbypt VI for some reason, here's another simple way. Less code!
06-25-2018 04:10 PM
@altenbach wrote:
... and if you don't want to use the ptbypt VI for some reason, here's another simple way. Less code!
Hey, that's slick I never would have thought of that.
06-25-2018 04:12 PM
I don't think I have that array min&max in my version of LV 2014.
The closest thing I could find is this