PLC programming theory algorithms and techniques 4