Each country must determine the Grid Code conditions and apply these criteria to integrate distributed generation (DG) systems into the existing electricity grid and to ensure a stable power system. Thus, experimental studies are required to provide an effective, national, and specific Grid Code. In this study, the Turkish Grid Code’s electrical criteria were examined, and the application of these criteria was carried out on a developed PV-based DG. A real-time energy management system (RTEMS) was proposed in the study. Electrical parameters on the developed DG were monitored in real-time by considering IEEE 1547, IEEE 929–2000, and Turkey’s electrical criteria. A practical grid code study was firstly investigated in detail about the Turkish Grid Code by a developed real-time monitoring-control and protection system. The proposed RTEMS method in the study is implemented as an inverter-resident system; thus, it provides advantages over many energy management systems embedded in the inverter. The degradation in power quality and non-detection zone (NDZ) problems encountered in active and passive island mode detection methods developed embedded in the inverter are eliminated in the proposed method. With the RTEMS method, where under and over-voltage, under and over voltage frequency, and unintentional island mode events can be detected in real-time, both the existing grid-code requirements are met, and the existing power quality and NDZ problem is eliminated with the recommended inverter-independent RTEMS method.