PLC principle and application examples