A Programmable Logic Controller (PLC) is an electronic device that takes input from the plant / machine via sensors and transmitters, executes the logic programmed in its memory and generates the useful outputs on actuators to control plant / machine.
A PLC is an example of a real time system since output results must be produced in response to input conditions within a bounded time, otherwise unintended operation will result.