Real - time Communication Design and Realization of Electric Valve Performance Test System
2025-10-03 04:06:22
**Abstract:**
This paper introduces 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 research is on implementing real-time communication between the PC and the SCM units using Visual Basic (VB). The proposed design enables the PC to effectively monitor and manage multiple remote devices in real time.
In many real-time monitoring applications, it is essential to receive data from remote locations quickly and reliably. To reduce system costs, SCMs are commonly used as data acquisition and recording units at remote sites, while PCs serve as the central management interface for human-machine interaction and communication. This paper presents a practical Master-Slave communication system designed for testing the performance of electrical devices. The lower-level system is controlled by a 32-bit ARM microcontroller (LPC2214), along with two CPLD chips (XC95108) for expanding I/O ports, enabling control of motors, photoelectric encoders, AD converters, and other peripheral devices. It also includes a keyboard for input and an LCD display for user interaction, as well as a printer for outputting test results. The PC platform is built using Visual Basic 6.10, ensuring accurate data processing and quality control. The system uses twisted-pair cables for communication, achieving stable and efficient data transfer.
The system ensures that only qualified products are released, enhancing product quality and market competitiveness. Communication between the PC and the SCM is implemented through VB's MSComm control, operating in asynchronous half-duplex mode via the 485 bus. This setup has been successfully deployed in production environments.
**1. Introduction**
Real-time monitoring systems often require the ability to collect data from remote locations efficiently. Ensuring fast and reliable data transmission is a critical challenge in such systems. To reduce costs, SCMs are typically used for data collection and local processing, while PCs act as central control units for managing and interacting with these remote systems. This paper describes a practical Master-Slave communication system designed for testing the performance of electrical devices.
The system's lower unit is based on an ARM microcontroller (LPC2214) and two CPLD chips (XC95108), providing expanded I/O capabilities for controlling motors, encoders, and AD converters. It also includes a keyboard for data input, an LCD for displaying information, and a printer for outputting test results. The PC-based management platform is developed using Visual Basic 6.10, allowing for real-time data processing and quality assurance.
Communication between the PC and the SCM is carried out over a 485 bus using twisted-pair cables. The system achieves high reliability and efficiency, with a data transfer rate of up to 19,200 bps. The PC sends tokens to the remote units, which respond with their data. This ensures accurate and timely control and data acquisition across multiple devices.
**2. System Structure and Working Principle**
**2.1 System Architecture**
The system consists of a central control PC and several remote units (RTUs). The control center includes a host computer and an RS232/485 converter, while the remote units are based on the ARM microcontroller, forming the core of the device performance testing system.
**2.2 Working Principle**
As a Data Terminal Equipment (DTE), the control center is responsible for data acquisition, processing, and storage. It communicates with the remote testing system via a 485 communication cable at a baud rate of 9,600 bps, with the option to adjust the speed between 1,200 and 19,200 bps. The remote unit collects field data using an optical encoder and an AD converter, transmits it via the MAX1480 chip, and controls peripheral devices through CPLD. The system also includes features like reset, fault alarm, and self-diagnosis.
Communication occurs in asynchronous half-duplex mode, where the PC sends a token to the remote unit, which then responds with its data. The PC verifies the received data and sends confirmation or error messages accordingly. This ensures reliable and real-time control and data exchange.
**3. Real-Time Serial Communication Programming**
**3.1 Communication Protocol**
Each data frame includes a start bit, 8 data bits, a parity bit, and a stop bit, totaling 11 bits. The baud rate is set to 9,600 bps, with the ARM microcontroller using a crystal oscillator of 11.0592 MHz for accurate timing. The PC’s serial port settings are configured via VB’s MSComm control. Both ends must match the same baud rate for reliable communication.
The system uses a token-passing protocol, where the PC sends a 4-byte message containing an identifier, address, command, and end marker. The remote unit checks the address and either processes the token or forwards it if there is a mismatch.
**3.2 Remote SCM Communication Program Design**
The remote ARM microcontroller receives data via interrupts and processes it using ADS112 programming. The flowchart of the PC communication subroutine and the interrupt routine of the remote unit are illustrated. The PC continuously sends tokens, and when a match is found, the remote unit uploads its data. After verification, the PC sends a confirmation or error signal.
**3.3 Host PC Communication Program Design**
VB 6.10 provides two methods for serial communication: API functions and MSComm control. The latter is more user-friendly, offering event-driven handling without requiring deep knowledge of low-level operations. The system uses a timer to send tokens and receive responses, improving response speed.
**3.4 Lower Computer Communication Programming**
The lower-level software, written in a C-like language, is compatible with the ARM microcontroller and supports efficient serial communication.
**4. Conclusion**
The system has been successfully applied in remote equipment monitoring, demonstrating stable data transmission with a low error rate and high-speed performance. Its ease of use and network compatibility make it suitable for industrial data acquisition and control applications. The system is ideal for high-precision measurement and automation tasks, offering a reliable and scalable solution for modern production environments.
American sanke keg,Beer keg,Stainless steel beer keg,1/2bb beer keg,european type stainless steel  beer keg
Wenzhou Deli Machinery Equipment Co., Ltd. , https://www.sungoodtech.com