programmable logic controllers

What are the Components of PLC & How does it Work?