Real - time Communication Design and Realization of Electric Valve Performance Test System
2025-10-03 04:09:46
**Abstract:** This paper presents a real-time communication system based on the 485 bus, which integrates a control center PC with multiple single-chip microcontroller (SCM) systems. The focus of this study is on implementing real-time communication between the PC and the SCM systems using Visual Basic (VB). The proposed design enables efficient remote control and management of multiple units from the central PC.
In many real-time monitoring applications, it is essential to collect data from remote locations quickly and reliably. To reduce system costs, SCM systems are often used as data acquisition and recording units at the field level, while PCs in the control center handle human-machine interaction and communication. This paper introduces a practical Master-Slave remote communication system designed for testing electric devices. The lower-level system is built around a 32-bit ARM microcontroller (LPC2214), along with two CPLD chips (XC95108) to expand I/O ports for peripherals such as loading/unloading motors, photoelectric encoders, and an AD converter. It also includes a keyboard for input, an LCD display, and a printer for outputting test results. The PC-based management platform is developed using Visual Basic 6.10. Through real-time performance testing, the system ensures that only qualified products leave the production line, improving product quality and market competitiveness. Communication is established via twisted-pair cables, with the PC using VB's MSComm control to communicate with the SCM system in real time. The system has been successfully implemented in a production workshop.
**1. Introduction**
Real-time data transmission from remote locations is a critical challenge in many monitoring systems. To address this, SCMs are commonly used at the field level for data collection, while PCs in the control center manage user interactions and system coordination. This paper describes a real-time communication system designed for testing electric devices, where the lower unit is controlled by an ARM microcontroller, and the upper unit uses VB for communication. The system allows for accurate data acquisition, control, and reporting, ensuring high-quality product output.
**2. System Structure and Working Principle**
The system consists of a control center and several remote terminal units (RTUs). The control center includes a host computer and an RS232/485 converter, while the remote unit is based on the ARM microcontroller for device testing. The PC communicates with the remote system via a 485 bus at a baud rate of 9600 bps, adjustable up to 19200 bps. The remote unit collects data using optical encoders and AD converters, transmits it via MAX1480, and controls peripheral devices through CPLDs. The system also supports reset, fault alarms, and chip status monitoring.
Communication occurs in half-duplex mode, with the PC sending tokens to the remote units. Upon receiving the correct token, the remote unit sends its data back. The PC then verifies the data and responds accordingly, ensuring accurate and reliable communication.
**3. Real-Time Serial Communication Programming**
**3.1 Communication Protocol**
Each data frame consists of 1 start bit, 8 data bits, 1 parity bit, and 1 stop bit, totaling 11 bits. The baud rate is set to 9600 bps. The ARM microcontroller uses UART0 for communication, with a crystal oscillator frequency of 11.0592 MHz to ensure accuracy. The PC sets its serial port baud rate via the MSComm control in VB. Both ends must match the baud rate for successful data transfer.
The system uses a token-passing protocol, where the PC sends a 4-byte message containing a header, address, command, and end marker. The remote unit checks the address and either accepts the token or forwards it if the address does not match. Once the token is accepted, the unit sends 158 bytes of data, including a start flag, command, data length, and end marker.
**3.2 Remote SCM Control System Design**
The remote system uses interrupts to receive data and employs software ADS112 for communication with the PC. The flowcharts for the main program and interrupt service routines are shown in Figures 4 and 5. The PC continuously sends tokens in a loop. When a remote unit matches the address, it receives the token, uploads data, and waits for confirmation. If no data is received or the data is invalid, an error flag is sent. Otherwise, the system proceeds normally.
**3.3 Host PC Communication Programming**
The PC uses VB 6.10 for communication, leveraging the MSComm control for ease of use. Two methods are available: polling and event-driven. Polling involves checking the ComEvent property periodically, while event-driven uses the OnComm event to handle communication errors. A timer is used to send tokens and monitor responses, ensuring fast and efficient communication.
**3.4 Lower-Computer Communication Programming**
The lower-level system uses ADS112, a C-like language, for programming the ARM microcontroller. This software is easy to implement and highly adaptable, making it ideal for real-time applications.
**4. Conclusion**
The system has demonstrated stable and efficient data transmission with low error rates, meeting the requirements for speed and reliability. Its ease of operation and network compatibility make it suitable for industrial measurement, control, and data acquisition. With further development, it can be applied in various high-precision environments.
Beer,Wort Counter flow chiller
Counter flow wort chiller
Counterflow heat exchanger
Counter-flow heat exchanger
Tube in shell heat exchanger
Counterflow plate heat exchanger for craft brewing/beer industry
heat exchanger,plate heat exchanger,shell and tube heat exchanger,tube heat exchangers,wort chiller
Wenzhou Deli Machinery Equipment Co., Ltd. , https://www.sungoodtech.com