1. A control device comprising: a communication unit which has a switch function of switching the control device into an energy saving mode, the communication unit communicating with an upper terminal via a first network; and a mode control unit which controls switching the communication unit into the power saving mode, the control being made using a network control library which is generated by a programming language.