06-22-2023 11:32 AM - edited 06-22-2023 11:32 AM
Hello, I usually run a while loop and store data in a shift register. It stores time and temperature data. I want to find out if the temperature has stabilized in last 15 minutes(Change in temperature between min and max is 2 degree celcius). But, I am not sure how to do that. Could any one help me with this?
Thanks,
Best,
Jarir
Solved! Go to Solution.
06-22-2023 12:05 PM
Well, a graph is just a passive indicator, so you need to operate on the array data. Assuming the values are spaced equally in time, you can calculate the time increment per array element and thus how many elements you need to account for 15 minutes. You could look at "array min&max" for that array subset. You could even use the ptbypt version with the history size matched to your time interval. You could also do a ptbypt linear fit of the last N points and see if the slope is below a certain threshold.
How noisy is the data? Maybe you need to reject outliers or apply some filtering.
06-22-2023 12:06 PM - edited 06-22-2023 12:07 PM
Are you storing an array of data, or a single point? You should store an array with at least 15 minutes worth of data.
If performance is not an issue, a simple way would be to write the data to a chart, making sure the history length accommodates at least 15 minutes worth of data. Then you can use a property node to read out the entire chart history and make your calculations on it.
06-22-2023 12:49 PM - edited 06-22-2023 12:58 PM
For each temperature location I take a reading every 15 minutes and call this Action Engine (or Functional Global variable)
It keeps the last four measurements in an array.
Everytime I update I rotate the array one position.
This throws out the oldest measurement and then I replace element 0 with the new measurement.
Then Min/Max the array and check to see of they are within 2 degrees
I misread your question. Our stabilization standard is temperatures variations must be less that 2 degrees for 4 consecutive 15 minute intervals
06-22-2023 02:24 PM
Hello @Knight of NI, I am storing the data to an array using build array function and shift registers. From here, could you please clarify more how I can store data in an array for the latest 15 minutes only. Because, with my approach, I store data for the whole time of the experiment.
06-22-2023 02:26 PM
I am storing the data in an array. Additionally, performance is also an issue. Is there any way to store the latest 15 minutes of data only?
06-22-2023 02:39 PM
You can look at the block diagram of a "PtByPt" VI to see how they limit the array to a maximum length.
One example is Mean PtByPt.vi
06-22-2023 02:49 PM
Also, here is a simple way to abuse a queue to do it for you.
06-22-2023 02:52 PM
This might work. Thank you
06-22-2023 02:52 PM
I will try this as well. Thank you.