0Introduction
In the monitoring and control and data acquisition system (SCADA) system, the real-time and accuracy of the collected data have a great impact on the system. A suitable communication network can effectively improve the benefits of the SCADA system. The application of the GPRS wireless terminal designed in this paper in the SCADA system solves the above problems. In addition to meeting the real-time and accuracy of data, it also has the advantages of low construction cost, simple structure, large transmission capacity, and remote control.
1 Terminal Introduction
1.1 Terminal structure
The wireless terminal is composed of EM310GSM module and STM32F103 single chip machine, with STM32F103 single chip machine as the core. STM32F103 single chip machine has rich communication interfaces for connecting EM310 and field instruments; it also has rich I/O resources, which can expand the RAM with larger capacity, on the one hand, to store instruction sets for interpreting instructions and making corresponding actions; on the other hand, it is used to temporarily store the data collected by the monitoring point. The terminal uses GPRS technology to communicate with the control center. The GPRS communication network has the advantages of low construction cost, fast networking, large transmission capacity and high transmission speed. Figure 1 is the structural diagram of the wireless terminal and the monitoring point instrument.
1.2 Application of terminals in SCADA system
The main task of wireless terminals in SCADA systems is to communicate via the GPRS network
The data transmission and reception between the monitoring point and the control center is realized through the Internet network, and its structure is shown in Figure 2.
1.2 Hardware Design
The main functions of the terminal are: data transmission and reception, command interpretation and control of monitoring point instruments. To meet the above functions, the circuit is mainly divided into several parts: EM310 module circuit, external RAM circuit and instrument serial port circuit.
(1) The EM310 module has certain requirements for the speed and capacity of wireless module data transmission in the SCADA system. In addition, some systems have higher requirements for the operating temperature of the terminal. Compared with Siemens MC55, EM310 has a wider high and low temperature range and can be applied to some occasions with higher temperature requirements; compared with GTM900B, it is smaller in size and more powerful in function. EM310 has a built-in protocol and can send 2K bytes at a time, which can meet the requirements of most SCA-DA systems; it has a MUX function and can realize the transmission of large amounts of data.
The function of the EM310 module is to receive data from the serial port of the STM32 microcontroller and send and receive wireless data to the STM32 microcontroller through the serial port. When connecting to the GPRS network, the SIM card verification is required, and the current status is displayed through the LPG pin. Therefore, the EM310 module circuit mainly includes the serial port part, the SIM card connection part and the LPG indicator light connection part, as well as the start and reset parts.
As shown in Figure 3, SIM_CLK, SIM_VCC, SIM_ON, and SIM_RST are the clock, power, data, and reset lines of the SIM card respectively; LPG is used to connect the network status indicator; RST is the reset pin, which is valid at low level. This pin is connected to GND with a 100nF capacitor in parallel near the 50PINB2B connector for electrostatic discharge protection; TERM-ON is the power on/off pin. Pull the TERM-ON pin low for 50ms to turn on the machine, and then pull the TERM_ON pin low for 50ms to turn off the machine. VDD-IO is the power pin of the I/O port. The relationship between the VDD-IO voltage U and the /DTR./RTS./TXD plus series resistance R is calculated as follows: R=3.5 * U-11.3K.
(2) External RAM
The external RAM is used to store instruction sets and temporarily store instrument detection data. When the terminal receives a data packet, the MCU will find the corresponding program segment in the RAM according to the received data packet and run the program segment, that is, perform the actions required by the control center, such as reading instrument parameters, setting instrument parameters, reading monitoring data, etc.
The read and write speed of RAM largely determines the response speed of the terminal after receiving the data packet. Therefore, the terminal uses high-speed static RAM IS61LV25616, which adopts ISSI's high-performance CMOS technology, uses highly reliable processes and innovative circuit design technology, and has the characteristics of high performance and low power consumption.
IS61LV25616 has a standby mode, which reduces power dissipation at CMOS input level. The RAM can be in standby mode when the terminal does not receive instructions and does not need to send data. The chip can also achieve memory expansion through the connection of the enable interface. Data access includes high byte access and low byte access.
(3) Instrument serial port
The instrument serial port is used to connect the monitoring point instrument with the single-chip microcomputer. The instrument serial port circuit selects the form of RS232 to TTL level, as shown in Figure 4. 1.4.6 of DB9 are short-circuited, and the RS232 level transmits and receives data through the transceiver SP3223EA. In SP3223EA, the polarity capacitor connected between C1+ and C1- is used as the pump capacitor of the voltage multiplier, and the polarity capacitor connected between C2+ and C2- is used as the reverse charge pump capacitor. TXfN is the TTL/CMOS driver input, TxOUT is the RS-232 driver output, RxlN is the RS-232 receiver input, and RxOUT is the TTL/CMOS receiver output.
SP3223EA realizes the conversion from TTL level to RS232 level by multiplication and inversion.
2 Software Design and Debugging
Software design requires the initialization of EM310, parameter setting, data sending and receiving through serial communication.
2.1 Program Flowchart
The serial port connecting the microcontroller to EM310 is serial port 1, and the serial port connecting to the instrument is serial port 2. In the main program, some global variables are first defined, and then initialized, including the initialization of the system and peripheral clocks, the initialization of peripherals and general IP ports, the serial port initialization, the timer initialization, and finally the loop is entered to check whether data is received or whether the instrument serial port needs to send data. If data is received, the subroutine for receiving data is entered, and if data needs to be sent, the subroutine for sending data is entered. The program flow chart is shown in Figure 5.
2.2 Debugging process and results
Here, the serial port debugging tool is used to simulate the monitoring point instrument. Data can be transmitted to the GPRS wireless data terminal, and then sent to the control center by EM310. The data received can also be read from EM310. TestGPRS software is used to simulate the control center software. Data sent from the serial port debugging tool can be displayed, and data can also be sent to the serial port debugging tool through the network.
(1) EM310 initialization
The initialization of EM310 includes signal detection, SIM card detection, mode selection, gateway registration, user name and password. When the signal strength is sufficient and the SIM card is correctly connected, you can register. First, select the mode to determine whether the module should compress and convert the input and output data; then register the gateway, user name and password; finally wait for the allocation of IP. The initialization sequence is: ① detect signal strength; ② detect whether the SIM card is correctly connected; ③ select the mode; ④ register the gateway; ⑤ register the user name and password.
(2) Set commands and send and receive tests
The setting command mainly involves the setting of protocol type, IP and port number. The IP and port number must be consistent with the IP and port number of the data center before data can be sent and received through AT commands. The method of setting and sending and receiving data is as follows:
Send: AT%IPOPEN="TCP" "210.32.34.65", 8001
Return: CONNECT
Send: AT%IPSEND="31323334354142" Send data 12345AB
Return: %IPSEND:1,15
OK
Use TestGPRS software to send AB1234 to port 8001, and then the serial port test tool will display: %IPDATA:1,1,6
Send: AT%IPDR
Return: %IPDR: 1,1,6, "414231323334"
OK
3 Conclusion
This solution can be applied to general SCADA systems. It has the characteristics of simple structure, strong scalability, low construction cost, fast transmission speed and fast connection. It can effectively solve the problem of high cost and difficulty in building communication networks in remote monitoring points. The debugging results prove the feasibility of the solution. The rich I/O resources and communication interface resources of the STM32 microcontroller can meet the needs of various SCADA system terminals and facilitate secondary development by users.
Previous article:Design of tension control system for printing press
Next article:Design of data recording device based on STM32 microcontroller
Recommended ReadingLatest update time:2024-11-15 09:26
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- STM8 Chinese Reference Manual
- Help with "SIM800C package - semi-circular arc problem"
- GD32L233C Sine Wave Generator
- [Watch the Power Supply Seminar and Win a Prize] A simple method to easily design AC-DC front-end modules
- Fixed-point programming of DSP floating-point calculation
- 【McQueen Trial】+Building Development Environment
- EEWORLD University ---- ESP8266 Development Tutorial
- GP9303 and GP8101 Circuit Review: Analog Signal Isolation
- MOS tube plus freewheeling
- [Problem Feedback] TangDynastyr returns to the first line when switching between different source files