Design and construction of a programmable logic controller