Research on Ethernet-based intelligent power monitoring terminal
2026-04-06 04:47:48··#1
Abstract: This paper introduces a power intelligent monitoring terminal system based on Ethernet. The system uses the 16-bit single-chip microcomputer XAS3 as the core processor and uses W3100 to perform TCP/IP protocol conversion to realize the network function of the equipment. Various functional modules in the system exchange data with the main processing module through the fieldbus. The system communicates with the dispatching system through Ethernet to realize remote monitoring of equipment in the substation. The paper focuses on how to use W3100 to perform TCP/IP protocol conversion to realize the Ethernet communication function of the system, and gives the specific hardware and software design. Keywords: Ethernet; W3100; intelligent terminal 1 Introduction TCP/IP protocol is the most popular international Internet protocol at present. Its combination with Ethernet is called Ethernet technology. Ethernet has the characteristics of low cost, high communication rate and good compatibility[1], which makes Ethernet technology not only used in the field of office automation, but also gradually involved in the fields of management network, monitoring network and field network. Power intelligent monitoring terminal equipment is an intelligent device for remote monitoring and control of substations and power plants. Its main functions include collecting various information and completing the control of equipment. To ensure the accurate and rapid response of the power grid to changes in switching signals, Ethernet is being used in power system dispatch automation systems to improve communication speed. Overcoming channel bottlenecks is a trend and an inevitable requirement. However, most current monitoring terminal devices are microcontroller systems, which present certain difficulties in achieving Ethernet interconnection. Several solutions exist: One solution is to use a high-end MCU and RTOS to handle TCP/IP protocol processing within an embedded operating system. While high-end MCUs can perform many complex processes, they are expensive, require the purchase of costly RTOS software, and have a long and complex development cycle. Another solution is to use a third-party Ethernet protocol converter, communicating with it via RS232C. The converter handles data encapsulation and protocol conversion, but its disadvantages include limited communication speed and the inability to control Ethernet. A third solution is to add a dedicated network protocol conversion chip to the existing equipment to achieve Ethernet interconnection, namely the solution described in this paper using the W3100 and an Ethernet control chip. This solution is characterized by low system resource consumption, ease of programming, and a short development cycle. 2 Introduction to W3100 W3100 is a TCP/IP protocol stack chip launched by WIZnet for Ethernet interconnection and embedded devices. W3100 can implement protocols such as TCP, UDP, IP Ver.4, DHCP, ARP and ICMP. At the same time, the network interface layer, including the MAC sublayer and DLC sublayer, is also implemented in this chip. It can provide four network connections at the same time, has a built-in 16K dual-port RAM as a data buffer, supports full-duplex mode, and the protocol processing speed can reach 4 to 5 Mbps. It also has a standard MII interface, which is convenient for connecting to Ethernet interface chips. WIZnet also provides a Socket API program package, which can accelerate the development of applications. 3 Hardware Principles 3.1 System Hardware Block Diagram The basic functions of the Ethernet-based power intelligent terminal device [5] include switch signal acquisition, analog data acquisition, output switch quantity and high-speed communication with the host computer system. The system hardware block diagram is shown in Figure 1. Figure 1 System hardware block diagram Figure 2 Network part schematic diagram The upper part of the figure is the implementation principle block diagram of the main processing module, which includes RAM, FLASH ROM, RTC, WatchDog, SJA1000, W3100 and serial communication conversion circuits. The system adopts the S3 series of the 80C51 XA sixteen-bit microcontroller produced by Philips. It has thoroughly improved the basic structure of the eight-bit controller and has the characteristics of fast execution speed, support for C language and multiple RTOS (real-time multitasking operating system) [2]. The RTC part in the figure is a clock chip with a precision of 10 milliseconds, which can ensure that the various logs in the system have accurate timestamps, so as to facilitate the analysis of faults by the scheduling automation system. The WatchDog circuit can reset the system when the system program is abnormal or the power supply fluctuates in a strong interference environment. Section 3.2 of this paper will introduce the design of the Ethernet interface. The DIM (digital input module) is responsible for collecting the status of various switching equipment in the substation. Its input is an empty node, which can realize single-point, double-point and instantaneous signal processing. The AIM (Analog Input Module) is responsible for acquiring various analog quantities within the station. Due to its strong isolation design, its input signals are compatible with both voltage and current. The DOM (Digital Output Module) implements the switch output function, and its empty nodes can control controllable switches, disconnectors, or fans within the station. All of the above functional modules have internal fieldbus interface circuits, and the entire system is based on the CAN BUS bus. The CAN BUS bus has the characteristics of flexible communication methods, node priority, "CSMA/CD" arbitration technology, long communication distance, high speed, and flexible communication media, making it particularly suitable for real-time monitoring systems [3,4]. 3.2 W3100 Interface Principle The system uses the W3100 as an Ethernet protocol converter and the RTL8201 as an Ethernet controller. The RTL8201 can implement all physical layer functions and is one of the most widely used Ethernet controllers. The system adopts the Direct Bus I/F working mode, and the network speed can be changed by setting it. Together, they complete the Ethernet communication function of the system. The schematic diagram is shown in Figure 2. 4 Software Design 4.1 W3100 Connection Establishment Process The W3100 provides Socket API interface functions similar to Windows, making it easy to implement its settings and send/receive operations. In this design, TCP/IP is used as the server side. Figure 3 shows the Socket establishment process. Figure 3 TCP/IP Connection Establishment Process 4.2 Software Implementation 1) Initializing the W3100 When initializing the W3100, a hard reset should be performed first, then the MAC address and IP address should be set, and finally the SOCKET interface should be initialized. ResetEthernet(); //Hard reset W3100 InitW3100A(); //Initialize W3100 InitNetConfig(); //Configure Ethernet card parameters InitSocket(); //Initialize SOCKET 2) Interrupt Service Routine According to the W3100 user manual, a hardware interrupt is provided in the system as the interrupt input for the W3100, and the status value is recorded in the interrupt service routine. The code is as follows. _interrupt(INT_PCA0) _using(INT_PCA0_PSW) { u_char status; status = INT_STATUS; while (status) { if (status & 0x01) { S_STATUS[0] = STATUS(0); INT_STATUS = 0x01; }//similar processing for the 1st, 2nd, and 3rd if (status & 0x10) { S_STATUS[0] = STATUS(0); INT_STATUS = 0x10; }//similar processing for the 1st, 2nd, and 3rd status = INT_STATUS; } INT_STATUS = 0xFF; } 3) Design a task to send and receive data at 10 millisecond intervals. The process is as follows. SOCKET i; INT len; WORD TSCKNUM = 2404; for (i = 0; SockNo < 4; SockNo++) { switch (Select (i, SEL_CONTROL)) { case SOCK_ESTABLISHED: if ((len = select (i, SEL_RECV))) > 0) { if (len > MAX_BUF_SIZE) len = MAX_BUF_SIZE; len = recv(i, data_buf, len); send(i, data_buf, len); } break; case SOCK_CLOSE_WAIT: if ((len = select(i, SEL_RECV))) > 0) {if (len > MAX_BUF_SIZE) len = MAX_BUF_SIZE; len = recv(i, data_buf, len); } close(i); break; case SOCK_CLOSED: init_sock(i); break; } } 5 Conclusion In the design and implementation of the power intelligent monitoring terminal, the W3100 is used as an Ethernet protocol stack converter, which has the characteristics of simple interface, convenient programming, high communication speed and stable operation. It can simplify the design difficulty and speed up the design process. Therefore, the W3100 has good application prospects in the rapid implementation of networked design. This paper adds a hardware protocol converter based on mature application technology, which reduces development risk, shortens the development cycle and improves the application level of the product. The power intelligent monitoring terminal system has been productized and has generated a total output value of 10 million yuan. The innovation of this paper: Based on mature application technology, a hardware protocol converter is added to reduce development risk, shorten the development cycle and improve the application level of the product. References [1] Yang Peng et al. Development and technical characteristics of industrial Ethernet, Microcomputer Information [J], 2006, 22-4: 32-24. [2] Wu Kuanming. 80C51 XA 16-bit controller system design, device and application development [M], Beijing University of Aeronautics and Astronautics Press, 1996. [3] Wang Yifeng, Li Lingqi. Application of SJA1000 in data acquisition and control system, Microcomputer Information [J], 2001, 17-4 7: 16-18. [4] Shi Jiugen, Zhang Peiren, Chen Zhenyong. CAN fieldbus system design technology, National Defense Industry Press, 2004. [5] Liu Jiajun. Microcomputer remote control technology, China Water Resources and Hydropower Press, 2001.