Bus network system design based on modular production line
2026-04-06 06:20:11··#1
Abstract: This paper mainly discusses the design of a bus network system based on a modular production line. Specifically, it aims to achieve resource sharing and optimized management of the MPS (Multi-Processing System) in a system environment with multiple PCs, one MPS production line, and multiple PLCs, ensuring that each PC has the opportunity to communicate with each PLC. This system utilizes an RS-232C bus and a microcontroller to form a bus network system. The microcontroller acts as the control station in the bus network, and through the RS-232C bus, bus adapter circuit, and corresponding software program, it manages and optimizes the configuration of the MPS control system resources—the PLCs. The significance of this design lies in maximizing the utilization of the MPS teaching and training system resources, fully improving the utilization rate and operability of experimental equipment, so as to achieve the best teaching effect within a limited time. Keywords: Modular production line; Resource sharing; RS-232C bus 1 Introduction In the field of industrial control, traditional field control methods are increasingly unable to meet the requirements of industrial automation. These control methods are not only time-consuming and labor-intensive but also very imperfect. With the continuous improvement of communication technology, industrial automation control systems have evolved beyond traditional field control methods, giving rise to a new mode of controlling production lines via fieldbus communication using a host computer. The control system in this design is a fieldbus network control system designed for the modular production system produced by FESTO. FESTO's MPS (Modular Production System) is a complete training system for automation control technology, composed of multiple modules and operating on a completely open system. Operators can combine, expand, and control various modules according to different needs. The MPS system closely resembles actual industrial production systems, making training based on it highly practical in university engineering education. However, MPS training systems are expensive and limited in quantity. To maximize the use of MPS resources, improve the utilization rate of experimental equipment, and achieve optimal teaching results within a limited time, a comprehensive resource allocation and management system needs to be designed. This system should optimize resource allocation to achieve resource sharing and time-sharing. This paper describes the structure, function, and hardware/software design of the bus network system for resource sharing. 2. Overall Scheme Design The MPS modular automated production line from the German company FESTO is a set of teaching and training equipment simulating a production line. It uses a Siemens S7-300 programmable logic controller (PLC) as the control system to control the entire automated production line. The core problem to be solved in the bus network system design is to achieve resource sharing among the PLCs controlling the MPS automated production line. Resource sharing can be simply described as "multiple-to-one" and "one-to-many". "Multiple-to-one" means that multiple PCs can communicate with the same PLC in a time-sharing manner, enabling multiple PCs to control a specific workstation on the MPS production line; while "one-to-many" means that a single PC can communicate with multiple PLCs, enabling one PC to control multiple workstations on the MPS production line. When designing the bus network system, the first step is to determine the hardware design scheme, that is, to connect the hardware environment devices in the bus network system—multiple PCs and multiple PLCs—in an orderly manner through hardware circuit design, and then coordinate with other necessary equipment to achieve resource sharing and allocation management. To achieve resource sharing among multiple PCs and PLCs, this design proposes a bus network scheme using a single microcontroller as the control station. This bus network scheme utilizes multiple PCs and one AT89C51 microcontroller, achieving resource sharing with the PLC via an RS232 bus and bus adapter circuit. To achieve resource sharing through the bus network, in addition to a suitable hardware environment, corresponding communication programs must be developed. The communication program design consists of two parts: the microcontroller's communication program and the PCs' communication program. The microcontroller's communication program is written in assembly language; its main function is to poll each PC to receive connection requests and send connection permission signals based on the request content. The PCs' communication program is designed using readily available programming software; its main function is to send connection requests and receive connection permission signals. These communication programs are not independent; they need to work in conjunction with the bus network's hardware adapter circuit. Only through their combined operation can resource sharing and optimized management be achieved. 3. Hardware Design of the Bus Network The hardware design of the bus network involves designing a bus adapter circuit capable of resource sharing and allocation management. The bus adapter circuit consists of two parts: a microcontroller polling circuit and a resource sharing circuit. The main function of the bus adapter circuit is as follows: the AT89C51 microcontroller, acting as the control station, uses a polling method to receive connection request signals and connection numbers from each PC via the RS-232C bus. After program analysis, the microcontroller sends a connection permission signal to the PC and issues an instruction to connect the control signal line of the PLC to be connected. Then, the program already programmed on the PC can be transferred to the PLC via the RS-232C bus, realizing resource sharing within the PLC. 3.1 Microcontroller Polling Circuit Design The microcontroller polls for connection requests from each PC to achieve communication between the PC and the microcontroller. The standard serial bus communication interface RS-232C is typically used for this communication. RS-232C is the most widely used standard bus in asynchronous serial communication. The simplest connection between a PC and a microcontroller is a zero-modulation three-wire economical type, which is the minimum number of lines required for full-duplex communication. The PC, microcontroller, and PLC are connected via a 9-pin standard socket. The microcontroller polling circuit in this design consists of a CD4052 chip and a MAX232 chip. The CD4052 chip is a dual-channel, four-channel analog multiplexer; one CD4052 chip can poll four PCs. The MAX232 is a dedicated integrated chip for converting RS-232C levels to TTL levels. The principle of the microcontroller polling circuit is shown in Figure 1. [align=center] Figure 1 Schematic diagram of microcontroller polling circuit[/align] 3.2 Resource Sharing Circuit Design The resource sharing circuit design aims to achieve the functions of "multiple-to-one" and "one-to-many". That is, multiple PCs can communicate with the same PLC in a time-sharing manner, while a single PC can communicate with multiple PLCs separately. This design employs an integrated circuit solution centered around an RS-232C bus and a multi-bit data selector. This integrated circuit achieves resource sharing through a row-column structured switch network circuit. Communication between the PC and PLC also uses the standard RS-232C serial bus interface, employing the simplest three-wire connection method. Therefore, this design selects the CD4053 chip as the data selection switch. The CD4053 chip is a three-way, dual-channel analog multiplexer. Taking four PCs sharing five PLCs as an example, the switch network circuit requires a total of twenty data selection switches (four by five), meaning twenty CD4053 chips arranged in a four-row, five-column (or five-row, four-column) row-column structure to form the resource-sharing circuit. The circuit principle is shown in Figure 2. [align=center]Figure 2 Schematic diagram of resource sharing circuit[/align] Control signal line RS-232C bus When the microcontroller polls and finds that a PC wants to communicate with a PLC, the microcontroller sends a control signal to the corresponding CD4053 chip control signal line connected to it, so that the switching channel of the chip is turned on, realizing the communication between a PC and a PLC. 4 Communication software design of bus network 4.1 Design of PC communication program The PC communication program is to realize the PC sending connection request signal and receiving connection permission signal sent back by the microcontroller. For this purpose, a control panel as shown in Figure 3 needs to be designed. [align=center]Figure 3 Schematic diagram of control panel[/align] In the communication of the bus network system, the communication is carried out by query and response. In order to ensure the reliability of communication and the accuracy of information transmission, a simple communication protocol is formulated for the main command words in the communication. The command word conventions for PC communication software and microcontroller software are as follows: Each command word consists of eight bits, where the highest two bits are the command word, the lowest three bits are the PLC serial number, and the middle three bits are the PC serial number. 00XX XXXX is the PC exit connection command word; 01XX XXXX is the PC request connection command word; 10XX XXXX is the microcontroller enable connection command word; and 11XX XXXX is the resource allocation command word. The PC communication program works as follows: When a PC wants to connect and debug with a PLC, it first enters a string consisting of a two-digit connection request command, a three-digit PC serial number, and a three-digit PLC serial number in the control panel dialog box, and clicks the OK button. The PC communication program then sends this eight-digit string to the microcontroller's serial port via the RS-232C bus. When the PLC is not in use, it receives a connection enable signal from the microcontroller and illuminates a green indicator light on the control panel. Once the PLC is in use, it receives a resource occupancy signal from the microcontroller and illuminates a yellow indicator light on the control panel. When the connection debugging between the PC and the PLC is complete, the PC enters a string consisting of a two-digit exit connection command, a three-digit PC serial number, and a three-digit PLC serial number in the control panel dialog box, and clicks the OK button. The PC communication program then sends this eight-digit string to the microcontroller's serial port via the RS-232C bus and turns off the indicator light on the control panel. Clicking the exit button exits the communication program. The PC communication program is designed using VB programming software. The MSComm control allows configuration of serial communication data transmission and reception, and settings for serial port status, information format, and protocol. It is a standard 10-bit serial communication interface, including eight standard data bits, one start bit, and one stop bit. 4.2 Design of the Microcontroller Communication Program: During data communication between the microcontroller and the PC, each communication session involves the PC sending a command data frame. The microcontroller communication program polls the serial port to receive command characters from the PC, analyzes these characters to determine which PC is connected to which PLC. When the PLC is not occupied, the software sends a connection control signal to the corresponding switch chip, enabling the chip to conduct, allowing the PC to connect and debug with the selected PLC, and sending a connection enable signal back to the PC. Once the PLC is occupied, a resource occupancy signal is sent back to the PC, temporarily suspending the connection. When the PC ends communication with the PLC, it sends an exit signal to the microcontroller. Upon receiving this signal, the microcontroller disconnects the switch chip and resumes polling. The AT89C51 microcontroller has a programmable full-duplex serial communication interface, allowing simultaneous data transmission and reception. Serial communication uses mode 1 with a baud rate of 9600 b/s, and the microcontroller uses a polling method for both receiving and transmitting data. Timer T1 uses mode 2 with an initial value of FDH and a crystal oscillator frequency of 11.0592 Hz. 5. Conclusion This paper, from the perspective of maximizing the value of the MPS production line and adhering to the idea of optimizing resource management and allocation, focuses on extensive, fundamental, and practical design work related to the MPS production line. This design not only fully utilizes MPS teaching and training resources, improving the efficiency of the MPS production line, but also assists in teaching, realizes intelligent and networked laboratory management, and stimulates students' learning interest. It is highly beneficial for students to understand the knowledge of modern industrial automation technology and enhance their practical abilities. The author's innovation lies in using the CD4053 chip as a data selection switch and designing a row-column structured switch network circuit to achieve resource sharing. References [1] Li Quanli, Zhong Weifeng, Xu Jun. Principles and Applications of Single-Chip Microcomputers [M]. Beijing: Tsinghua University Press, 2006. [2] Liu Zenghui. Application Technology of Modular Production and Processing System [M]. Beijing: Electronic Industry Press, 2005. [3] Xia Jiqiang, Sun Jin. Crane Monitoring System Based on Fieldbus [J]. Microcomputer Information, 2006, 10-1: 293-295.