LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Program Stop

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.

0 Kudos
Message 1 of 8
(4,340 Views)

sorry forgot to add this too just in case

0 Kudos
Message 2 of 8
(4,334 Views)

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.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 8
(4,321 Views)
  • You did not attach your subVI
  • Use mean ptbypt to calculate the running average. No other code needed.
  • To stop on alternative conditions (comparison result or stop button), look in the boolean palette for OR. 😄
0 Kudos
Message 4 of 8
(4,296 Views)

tc.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 8
(4,252 Views)

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!

0 Kudos
Message 6 of 8
(4,236 Views)

@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)

0 Kudos
Message 7 of 8
(4,229 Views)

Yeah, I can't think of any occasion when I would have used a multi-element shift register, it was just surprising to see!

0 Kudos
Message 8 of 8
(4,219 Views)