Hi, I'm programming for a machine. The machine has a E-Stop (hardware) button. I wired the button to a digital input.
The way I monitor the E-stop in my program is to make a Do-While loop separated from the main part of my program. Inside this Do-While loop, a boolean will be toggled based on that digital input status (high or low). The main part of my program will respond to the E-stop button based on the status of the designated boolean.
One disadvantage of this approach is there could be too many Do-While loop (currently the main part already has two While loops). Any other way to monitor that E-stop button?