https://learn.automationcommunity.com/gate-logic-using-plc-program/
Gate Logic using PLC Program