Thread Content
Abstract: The standards IEC 870-5-1 and IEC 870-5-2, developed by IEC TC57 for data transmission in remote control systems, form the basis of the data link layer in DNP V3.00. The DNP 3.0 protocol provides an international standard specification for SCADA systems. The standard protocol has a wide range of applications and powerful functions, which can **reduce the workload associated with power grid maintenance**. The Feeder Terminal Unit (FTU) is an important component in the distribution automation system. Keywords: Distributed Network Protocol DNP3.0, wireless FTU, distribution automation. The DNP 3.0 (Distributed Network Protocol Version 3.0) protocol is an open-standard protocol that is widely used in Europe and North America; it is gradually becoming one of the mainstream communication protocols in China as well. It can be used for communication between power system substation systems, RTUs, intelligent electronic devices (IEDS), and master station systems. Since most foreign distribution automation (DA) devices currently support DNP3.0, in order to ensure compatibility and standardization of power equipment, most FTUs used in conjunction with foreign power main stations employ the DNP3.0 communication protocol. As an important part of the distribution automation system, the FTU must not only perform basic measurement and monitoring functions but also establish communication with the remote master station. This design uses an ARM as the main processor, and modularizes the various functional components in a multi-processor architecture, with each component operating independently without interfering with the others. The main processor controls and coordinates the operation of these functional units as well as the data exchange between them. This approach not only reduces the need for equipment maintenance but also takes advantage of the redundancy available to ensure the proper functioning of the electrical equipment. Figure 1: Composition of the wireless FTU system. Figure 1 shows the structure of the wireless FTU system; wireless networks such as GPRS/CDMA are used as the communication medium. Data from mobile service providers is transmitted to computers in the local network of the power monitoring center via wireless or Internet connections, thereby enabling remote automated monitoring through this efficient approach. Due to the special operating characteristics of electrical terminal devices, as well as the requirements regarding their installation location, operating environment, and reliability and stability, traditional wired networks can hardly meet the needs of networking electrical equipment. The wireless FTU is an improved version of those that use standard communication protocols; it enables the networking of power equipment via GPRS/CDMA networks. While ensuring normal operation, it enhances the automation level of power networks and facilitates a more efficient networking of power monitoring devices. Introduction to the DNP3.0 protocol: The DNP3.0 protocol is a communication standard developed on the basis of the TC57 protocols of the International Electrotechnical Commission (IEC); it supports ISO’s OSI/EPA model. This model defines the physical layer, data link layer, and application layer. However, to support advanced RTU functions and messages larger than the maximum frame size, the DNP3.0 data link uses a pseudo-transmission layer to assemble and decompose the shortest messages. Figure 2 shows a comparison of the communication models. 2.1 Framework structure of DNP3.0 The text of the DNP3.0 specification is divided into 4 parts: data link layer specification, transmission functions, application layer specification, and data object library. http://www.avrw.com/article/pic/200681917485580.gif Due to the efficiency of assembly language in terms of hardware control and processing speed, it might seem cumbersome to implement the entire CRC section in assembly when dealing with protocols. However, since assembly language allows for bit-level control similar to the operations with unions in C language, using a method of assigning values to bits individually for protocol control makes the protocol handling simple and straightforward. The combined use of C and assembly, leveraging the strengths of each, enables DNP communication while also improving response speed and code quality. The basic unit of the frame format in the DNP3.0 specification is the byte; therefore, according to the hierarchical structure of DNP3.0, there are definitions for the link layer control word, pseudo-transmission layer control word, application layer control word, application layer function code, FTU internal state 1, FTU internal state 2, and so on. Build the processing procedure flow in layers in accordance with the data flow of DNP3.0 specification. The DNP3.0 specification details the hierarchical structure of the protocol as well as the functions of each layer; by complying fully with this specification, programs can achieve standardized communication. The link layer processing flow of the DNP protocol is shown in Figure 3. 2.2 Implementation of the CRC algorithm in DNP3.0 CRC verification is a crucial element for ensuring reliable communication; the protocol requires verification of both the message header and each data block, with the checksum being sent along with the data. When the master station receives the message, it can analyze the information contained within it to determine whether the communication was successful. Below are the analysis methods along with the CRC verification program in assembly language, as applied in practice. The generating function for CRC is: P = G(X) = X16 + X13 + X12 + X11 + X10 + X8 + X6 + X5 + X2 + 1. CRC = (M2^16) / G(X). The specific implementation details are as follows: To send a data block: · Take the user data block M, whose length is K bits. ·Multiplying M by 216 gives 216M. ·Divide the ratio by (mod 2 divide) P (17 bits) to obtain the remainder R (16 bits). ·Negating R gives R’. ·Attach R’ after 2 16M and send it as a data block (T‘). Receive a data block: ·Receive a data block (T‘) which has (K+16) bits. ·By inverting R’ in T’, we obtain T, which is still (K+16) bits. ·Divide T by P to obtain its remainder. ·If the remainder is non-zero, the data block is erroneous; otherwise, the data block is correct. Implementation in assembly language: (implemented using a lookup table; the specific table is omitted) PROC ASKCRC ; Input parameter: the number to be converted ; 0A0H: The starting position of the data ; Export parameters: CRCL CRCH ; Parameters to be protected: 10H, 11H, 12H, 13, 14H, R6, R1, A. ASKCR: MOV R1, #0A0H; MOV DPTR, #CRCTAB; MOV 10H, #0 ; CRCL MOV 11H,#0 ; CRCH CRC1: http://www.avrw.com/article/pic/200681917485621.gif MOV A,@R1 MOVC A,@A+DPTR MOV 12H,10H MOV 13H,#0 ANL 12H,#0FFH XRL 10H,#0 XRL 11H,A MOV A,12H ORL 10H,A MOV A,13H ORL 11H,A MOV R6,#8 CRC2: MOV 14H,11H ANL 14H,#80H CLR C MOV A,10H RLC A MOV 10H,A MOV A,11H RLC A MOV 11H,A MOV A,14H CJNE A,#80H,CRC3 XRL 10H,#65H XRL 11H,#3DH CRC3: DJNZ R6,CRC2 INC R1 DJNZ R7,CRC1 XRL 10H,#0FFH XRL 11H,#0FFH MOV 12H,10H MOV 13H,11H MOV A,10H MOVC A,@A+DPTR MOV 13H,A MOV A,11H MOVC A,@A+DPTR MOV CRCL,A MOV CRCH,13H RET http://www.avrw.com/article/pic/200681917485360.gif 2.3 Setting of the object library for DNP3.0 Intelligent devices that use the DNP application layer protocol can be monitored and controlled; they generate a large amount of data, both in terms of software and hardware. This data is referred to as “information units”. Regardless of its data source, the profile documents of a device must specify the exact data source and meaning for each data object of that remote control device. FTU needs to measure and monitor the power grid; therefore, the coding standards for DNP information units or the data objects used in the DNP application layer must be defined. Figure 4 shows a communication format used when implementing the application. FTU currently has various communication protocols. Since the DNP3.0 protocol is internationally standard, this function is available in most electrical equipment. Furthermore, given the powerful capabilities of the DNP3.0 protocol and its coverage of many aspects, different functional units can be implemented on FTU devices with varying requirements according to on-site needs, without the necessity of having all functions available. With the development of industrial bus networking and the increase in levels of industrial automation, industrial devices that rely on wireless networks will inevitably see further progress, and communication protocols will also evolve toward being more universal.