@CNCModeller Thank you so much for your reply and letting me know what you did. We actually decided to hook up the magnetic switch to the PWM output so the laser will have a duty cycle of 0 when the lid is open. I do think in the future we will also have a manual hardware switch.