My synthesis of how a PLC could work...