In this paper a microgrid composed of a diesel generator and two uninterruptible power supply systems with separate battery banks is introduced. The microgrid located in three academic buildings of Tallinn University of Technology. A three-level control and monitoring system for the microgrid based on the EtherNet/IP communication network is developed. In addition, a control strategy of the microgrid in the grid-connected and stand-alone mode of operation is proposed