I am creating a simple control loop for a safety door for a machine. When the door is opened, the machine turns off. When its closed, the machine can operate. The way I have it set up now is that we are looking for the door to be open, and if its open the sensor will tell the controller and the controller will flip a switch and the machine will turn off. I feel like the output just does not make sense. I think I am maybe confusing what the set point should be, but I am not sure. This is just a little project I am doing to better understand safety/security control loops, but I think I may be over thinking this one a bit. Any help appreciated.
Here's a link to my current design.