Nowadays limitation of energy sources has increased the demands for using Distributed Generation (DG) in electricity generation. Entrance of DG to network is accompanied by some problems in network protection. DGs connection to network makes some problems in coordination between protection relays. Wrong operation of relays interns irreparable shocks to network. So for increasing the protection of DG in distribution network we should solve protection problems. In this article at first the problems that caused by entrance of DGs in protection system, are presented. After that an error detection system in function of relays based on Petri net is introduced. In the past, Petri net was used for radial system protection in presence of DG. The main goal of this article is explanation of Petri net structure corresponding to ring distribution network and use of backup relay for insurance of DG separation from network.