(* Motor start/stop station. *) (* Start runs the motor and it keeps running when Start is released. Stop and E-Stop both stop it, and while E-Stop is pressed Start must do nothing. Light the Running lamp whenever the motor runs. Both stop buttons are wired normally closed, so they read 1 when nobody is pressing them. *) VAR_GLOBAL Start_PB AT %IX0.0 : BOOL; (* Start pushbutton, normally open *) Stop_PB AT %IX0.1 : BOOL; (* Stop pushbutton, normally closed, 1 when healthy *) EStop_OK AT %IX0.2 : BOOL; (* Emergency stop, normally closed, 1 when healthy *) Motor AT %QX0.0 : BOOL; (* Motor contactor *) Run_Lamp AT %QX0.1 : BOOL; (* Running indicator *) END_VAR PROGRAM Main (* Write the logic here. *) END_PROGRAM