Role of the grid code
The grid code regulates the general conditions pertaining to how installations connect to the high and extra-high voltage grid. The code also covers grid usage, system services, grid expansion, and general grid operation. Depending on the country, conditions for the grid at the low-voltage or distribution level are fixed separately (often in a distribution code). The rules of the grid code apply to all systems that feed into the grid control network, from a large power plant producing several hundred megawatts to a solar plant producing just 500 kW. Among other things, the grid code defines specific conditions that must be met for plants to receive pre-qualification and participate in providing grid frequency measures. Ciaran Roberts provides a good overview of the varying international grid code regulations in a document written for the Lawrence Berkeley National Laboratory (funded by the US Energy Regulatory Commission, Office of Electric Reliability).