07-11-2017 11:15 AM
Hi,
I have a VI with multiple T-Couple channels. I got the channels split up and to the array max and min function. How do I hold the highest and lowest values for the entire run? Every time it receives new values(every 5 seconds) the max and min change to the latest data reading.
Thank you
Solved! Go to Solution.
07-11-2017 11:57 AM
Use a shift register to hold the max (or min) value, like this:
Is this what you mean or are you asking about something more complicated?
07-11-2017 12:01 PM - edited 07-11-2017 12:02 PM
If you have this running in a while loop that acquires the array of thermocouple readings it should look something like this with the MAX value held on top and the MIN value held below until stopped. Be sure to preload the MAX with -INF and the MIN with +INF.
07-11-2017 12:09 PM
What do you mean by the INF's and what is the function in the middle?
Thank you so much
07-11-2017 12:15 PM - edited 07-11-2017 12:18 PM
@Minions wrote:
If you have this running in a while loop that acquires the array of thermocouple readings it should look something like this with the MAX value held on top and the MIN value held below until stopped. Be sure to preload the MAX with -INF and the MIN with +INF.
Try that and look at the output
SpoilerMax equal +inf And Min -inf Facepalm moment
Use NaN
The middle function is "Build Array" and it is adding the current max and min the the array to test for max and min
07-11-2017 12:16 PM
@Amanda_Kay wrote:
What do you mean by the INF's and what is the function in the middle?
Thank you so much
Here is what I meant by presetting the MIN & MAX values. The vi in the middle is supposed to be a representation of all of your thermocouple readings being gathered into an array.
07-11-2017 12:21 PM
@JÞB wrote:
use NaN
Yes, tried to simplify without looking at the pitfall before me. Back to the Etch-A-Sketch.
07-11-2017 12:23 PM
This might be a stupid question but how do I get the positive and negative infinities at the while loop end points?
07-11-2017 12:26 PM
Nvm, I found it
07-11-2017 12:30 PM
@Amanda_Kay wrote:
This might be a stupid question but how do I get the positive and negative infinities at the while loop end points?
Amanda,
Like Jeff wrote, you will need to simply create a DBL value and type in NaN (rather than +INF or -INF) by right-mouse-clicking on the shift register at the input to the loop then selecting Create > Constant. To get the other constants, use the right-mouse-button (RMB) and select NUMERIC under the PROGRAMMING tab to find those options.