09-22-2017 12:25 AM
Hello I want to stop a running graph so that the loop stops either if the stop button is pressed or if the current temperature is within 0.4 degrees of the average temperature from the 2nd and 4th previous readings. The Temperature Monitor VI acquires and displays temperature and averages the last five temperature measurements and display the running average on the waveform chart. I know this might be super simple but I can not wrap my head around how I should go about this. Thank you.
09-22-2017 12:30 AM
sorry forgot to add this too just in case
09-22-2017 01:12 AM
Not able to VIEW Your code,
But the Problem looks simple that first make sure at what conditions you want to stop the loop (Temperature Measurement/ Stop Button) and Make an OR case to Stop the Loop.
09-22-2017 02:12 AM
09-22-2017 12:17 PM
09-22-2017 01:59 PM - edited 09-22-2017 02:00 PM
This is the first time I've ever seen a shift register with multiple elements like that. I guess I've never tried right-clicking on a shift register before. You learn something new every day!
09-22-2017 02:18 PM
@arteitle wrote:
This is the first time I've ever seen a shift register with multiple elements like that. I guess I've never tried right-clicking on a shift register before. You learn something new every day!
Don't get used to it, because it is clumsy and not scalable. There are always better solutions!
Imagine tomorrow your manager asks you do modify the code to take the average of the last 2000 points. Written correctly from the beginning, all you would need to do is to change a single diagram constant! Using the expanded shift register approach would require a complete code rewrite! (See also the links in my old comment here)
09-22-2017 03:34 PM
Yeah, I can't think of any occasion when I would have used a multi-element shift register, it was just surprising to see!