|From the National Electrical Manufacturers Association: A programmable logic controller is a digital electronic device that uses a programmable memory to store instructions and to implement specific functions such as logic, sequence, timing, counting and arithmetic to control machines and processes. The figure below shows a simple schematic of a typical programmable logic controller.
At the center of the figure above you see the central computer. In reality this computer is not that different from the desktop computer you use every day. It is "hardened" for the factory environment but has a microprocessor, non-volatile memory and perhaps network connections - just like your computer. The software may be coded in a specialty language, such as ladder-logic, but it is still software that is coded by a programmer.
The parts of the PLC that are quite different from the typical desktop computer are the input and output modules. These modules allow the PLC to communicate with the machine. The inputs may come from limit switches, proximity sensors, temperature sensors, etc. Based on the software program and the combination of inputs, the central computer will set the outputs. These outputs may control motor speed and direction, actuate valves, open or close gates, and control all the motions and activities of the machine.