35kV/A Substation Remote Monitoring and Control System
2026-04-06 03:31:38··#1
Abstract: This paper introduces a method using the Server/Client Socket communication control in Delphi 7.0 and a GSM/GPRS Modem SMS module, employing the Modbus communication protocol to achieve remote measurement, remote signaling, remote control, and remote adjustment for three-phase three-wire electronic multifunction meters, digital plant (station) transformer protection and control devices, and DC power supplies. The C8051F020 microcontroller is used to encapsulate and unpack data using the MODBUS protocol for different communication protocols. This paper details the implementation of the communication process and provides the design program. Keywords: Modbus protocol, GSM/GPRS Modem, C8051F020, Server/Client Socket, RS-485 Abstract: By using the Server/Client Socket component of Delphi 7.0, as well as a GSM/GPRS Modem, this research realizes remote control of the multi-function ammeter, the digital circuit protector, and the DC-screen using the Modbus protocol. The C8051F020 MCU is used to complete the data transmission of different packaged and unpackaged communication protocols within the Modbus protocol. This paper describes the communication process and provides the design procedure. Keywords: Modbus protocol, GSM/GPRS Modem, C8051F020, Server/Client Socket, RS-485 1. Overview: This project mainly completes the remote real-time control and data acquisition of a 35kV/A substation. It uses a master-slave response communication method based on Ethernet transmission. In this project, the three controlled objects each have their own internal communication protocols: the multi-function meter follows the 645 communication protocol, the DC power supply follows the 451 communication protocol, and the line protector follows the 103 communication protocol. Data from these three different communication protocols must ultimately achieve full-duplex communication with the host computer in the monitoring center. This enables telemetry, remote signaling, remote control, and remote adjustment, such as: remotely measuring real-time operating parameters of the substation, including power factor and energy; remotely controlling circuit breakers and main transformers at various voltage levels; and remotely adjusting the DC power supply bus voltage and the meter's time-of-use rate. To ensure data reliability throughout the transmission process, the three protocols are unified into a single communication protocol. This paper uses the control of the multi-function meter as an example to illustrate the implementation method of the entire project. The data frames of the three devices (e.g., meter protocol: frame start character, address field, frame start character, control code, data length field, data field, checksum, end character) are used as data units of the Modbus protocol. Modbus protocol addresses and functional units, as well as CRC checksums and end characters for Modbus data frames, are added to each communication device. As shown in Tables (I) and (II), the C8051F020 microcontroller is used to complete the MODBUS encapsulation and decapsulation (restoring the data frames of each controlled device) of the data frames between the monitoring center and the three controlled devices. The SMS module is used to complete the long-distance transmission of data. The data flow is shown in Figure (I): Table (I) Data Frame Format of Multi-Energy Meter 645 Protocol Table (II) Meter Data Frame Encapsulated with MODBUS Protocol [align=center] Figure (I) Data Flow Diagram[/align] 2. Host Computer Communication Program The Server/Client Socket control of DELPHI 7.0 is used to implement the sending and receiving of host computer data. Since the host computer needs to both receive and send data, it needs to act as both a server and a client. The properties, methods, and events of the Server Socket are set as follows: ServerSocket1.Port:=5000; // Listen on port 5000 ServerSocket1.Active:=true; // Open the server ServerSocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket); Begin // Listen on port 5000 to receive data from the GSM/GPRS Modem. Call the corresponding procedures and functions to process and display the received data. end; The properties, methods, and events of the ClientSocket are set as follows: Procedure TForm5.initButClick(Sender: TObject); begin ClientSocket1.Host:=218.195.248.91; // Server IP address form1.ClientSocket1.Port:=5000; form1.ClientSocket1.Open; // Open the client end; Use ClientSocket1.Socket.SendText(); to send command data frames. //CRC check code solution procedure TForm1.GetCRC (Data:array of byte;Nums:integer;var CRCH, CRCL: byte); var i,j:integer; CRC:integer; begin CRC:=$FFFF; for i:=0 to Nums-1 do begin CRC:=CRC xor ord (Data[i]); for j:=0 to 7 do begin if (CRC mod 2=1) then begin CRC:= CRC div 2; CRC:=$A001 xor CRC end else begin CRC:= CRC div 2; end; end; end; CRCH := crc mod 256; CRCL := crc div 256; end; 3.GSM/GPRS Modem settings Setting up GPRS The SMS module uses a transparent transmission mode. This study uses the DTU module from Beijing Jiafuxin Technology, configured using its provided tool (or serial port debugging assistant). The DTU module settings are as shown in Figure (II), including serial port settings, server IP, and port. [align=center] Figure (II) GPRS Module Settings[/align] 4. Lower-level Program The lower-level program uses a C8051F020 microcontroller to perform protocol conversion related to MODBUS. The C8051F020 provides two serial ports, UART0 and UART1. This study uses four C8051F020 chips to create four protocol conversion modules. Three of these are connected to the controlled object. UART1 is connected to the RS485 bus of the controlled object, and UART0 is connected to the fourth protocol conversion module UART1 via RS485. The UART0 of the fourth protocol conversion module is connected to the GSM/GPRS Modem. Lower-level machine program code: void UART0_Init (void) { //UART0_Init initialization PCON |= 0x90; SCON0 = 0xd0; // SCON0: Mode 1 enable RX CKCON |= 0x20; T2CON = 0x30; //Timer 2 as UART0 baud rate generator RCAP2=65536-(SYSCLK/BAUDRATE0/32); T2=RCAP2; //Timer 24 initial count value TR2 = 1;} void UART1_Init (void) { // UART10_Init initialization SCON1 = 0x50; CKCON |= 0x40; T4CON = 0x30; //Timer 4 as UART0 baud rate generator RCAP4 =65536-(SYSCLK/BAUDRATE/32); T4 = RCAP4; // The initial count value of timer 4 is T4CON |= 0x04;} The lower-level machine uses a lookup table to solve the CRC check code. [align=center] Figure (III) Upper-level machine control sub-interface[/align] 5. Conclusion This study uses the MODBUS protocol to encapsulate data frames of different communication formats to realize the distributed control and centralized management of different controlled devices. References [1] Bao Kejin. C8051F single-chip microcomputer principle and application [M]. Beijing: China Electric Power Press, 2006. [2] Zhao Lantao, Su Yanhua. Delphi serial communication technology and engineering practice [M]. Beijing: People's Posts and Telecommunications Press, 2004.