PLC programming and operation