# The Application Design of an Improved PLC Linked Network Communication in the Production Line

Authors: Fanghong Tang; Feihu Zhu; Huarong Hu
Journal: Mobile Information Systems
 (2021)

---

## Abstract

This paper mainly introduces an improved PLC communication program based on PLC link network communication. Read and write corresponding production data at different time periods through the shared link area, and use link location soft elements as interactive handshake signal. The main station download module and slave station upload module are designed to complete the large range of data transmission interaction between master and slave stations, and the control system is realized in the automatic production line for drum brake pad processing.


---

## Body

## 1. Preface

In the design of the automated production line control system, if the line body has more than three stations and it is modularly distributed, the distributed network control mode is generally adopted. It is a control mode in which each workstation corresponds to one or more PLCs and then forms a network for the PLCs to realize data interaction. The PLC networks usually consist of level 3 or 4 subnets specifically. The communication protocol determines the communication process of all levels of subnets. In the communication protocol, the communication method is its key factor. Communication methods include access control methods and data transmission methods. The former is also called the access control method, which means how can a communication initiator obtain the right to use the communication network. The latter means how does a communication initiator transmit data after obtaining the right to use the network.Common communication methods include cycle I/O communication, link network communication, master-slave bus communication, token bus communication, floating master communication, and CSMA/CD communication. The link network communication method is widely used in the PLC control network of the medium-sized automated production line due to its simple structure and stable and reliable performance. However, as a whole network, it is the communication mode for sharing a specified memory area, and its communication data volume is limited and is greatly restricted. From the related literature, Zhang Tianyu et al. described the application of PLC network in industrial field control from the perspective of concept introduction [1]. Ma et al. introduced a communication realization based on Mitsubishi Q series PLC network system [2]. Wei Ting et al. introduced the application of the distributed PLC network control system in oil field pumps [3]. The research on the PLC link network communication method is less involved, especially the related research on optimization and improvement of its shortcomings, which has not yet been discovered. Based on the PLC link network communication method, this article takes another approach and proposes an improved PLC communication program design method. And, in the drum brake pad, the automatic processing production line control system has been realized and has achieved good results.


## 2. Introduction to Link Network Communication

The link network communication method is a communication method of serial shared storage area. It is mainly used for communication between PLCs with link area. The basic idea is that a certain range of the memory of each PLC in the network is as a link area. Each link area uses a mailbox structure [4, 5]. The sending area with the same number has the same size as the receiving area, and they occupy the same address segment: one is the sending area, and the others are all receiving areas. It uses broadcast communication. The specific implementation is as follows. 1#PLC sends the data in its sending area to the network, and other PLCs receive the data and store it in its corresponding 1#PLC receiving area. 2#PLC sends the data in its sending area to the network, and other PLCs receive the data and store it in their corresponding 2#PLC receiving area. In this way, each PLC broadcasts and sends data in turn. It can be seen from the above implementation that the data in the link area of each PLC in the PLC network should be consistent. It can be called the equalization communication process. The link area contains not only the data sent by this PLC but also the data received from other PLCs. Therefore, the PLC only needs to visit its own link area; that is, it visits the link area of other PLCs, thus realizing the data interaction of each PLC in the network [6].The refresh mode of the PLC link area can be refreshed asynchronously or synchronously. Asynchronous refresh has nothing to do with the user program in the PLC, and the communication processors of each PLC carry out broadcast communication in sequence. It goes over and over again, keeping all the link areas equalized [7]. Refresh in the synchronous mode is to start a refresh by sending instructions to the link area in the user program. In this way, it is refreshed only when the data in the sending area of the link area changes [8]. Refresh in the asynchronous mode is generally used.Take Mitsubishi FX5/FX3 series PLC as an example; its link network control block diagram and link area distribution are shown in Figure1. Its hardware connection mode adopts RS485 module for networking. In actual operation, it can be realized by using built-in 485 port or external 485 communication adapter. The details are shown in Figure 2 [9].Figure 1
FX5/FX3 series PLC link block diagram.Figure 2
FX5/FX3 series PLC link block diagram.


## 3. Control System Analysis

Drum brake pad processing automatic line is an automatic production line after transformation and upgrading. This is a typical significance. It is based on the production process of drum brake pads and integrates mechanical automation, servo control, PLC control, and other technologies to realize automated production. The whole production line can be divided into front and rear parts. The front part is for grinding and the back part is for drilling. There is a relay truss connection in the middle. It can be divided into automatic feeder, cylindrical grinder feeder and cylindrical grinder, inner arc grinder feeder and inner arc grinder, end grinder feeder and end grinder, chamfer grinder feeder and chamfer grinder, chamfer grinder cutting machine, transfer truss, servo drilling machine, feeding truss, and automatic rewinding machine. Four of the grinders and servo drilling machines are the original processing equipment, and the others are newly designed equipment for this automatic line.Starting from the actual production, in the technical route of the control system design of the automatic processing production line, the following factors are mainly considered [4, 10, 11]:(1)
The entire system adopts a distributed control mode, that is, each automation equipment has its own control system. It can be distributed and independently controlled or connected to automatic control.(2)
Because, more specifically, there are 11 stations in the whole system, it is more convenient to use two sets of main control interfaces. As mentioned above, the whole system can be divided into front and rear parts. The front part is for grinding and the back part is for drilling. Therefore, its control system is also divided into two parts, grinding processing and drilling processing, which exchange data with each other through communication.(3)
The PLC selection of each station is based on actual needs. The servo control of 2 axes and below adopts Mitsubishi FX3UPLC and the 2–4 axes adopts Mitsubishi FX5U.(4)
The RS485 networking mode is adopted between PLCs. The front section uses the PLC of the chamfering grinding and blanking machine control system as the main station; the slave stations include automatic feeding machine, external grinding machine and external grinding machine, internal arc grinding machine and internal arc grinding machine, end grinding machine and end grinding machine, chamfer grinding machine and chamfer grinding machine, and other working stations; the PLC of the drilling truss control system is used as the master station in the back section, and the slave station includes Transfer truss, 1# servo drilling machine, and automatic material collecting machine.The system control block diagram is shown in Figure3.Figure 3
System control block diagram.Take the previous grinding processing control system as an example. The entire network has 6 stations, which meet the requirement that the Mitsubishi PLC link network cannot exceed 8 stations at most. In the design, the PLC of the automatic control system for chamfering grinding and blanking is used as the main station. Automatic feeding system, cylindrical grinding automatic feeding system, internal arc grinding automatic feeding system, end-face grinding automatic feeding system, and chamfering grinding automatic feeding system are slave stations. The link area distribution is shown in Table1.Table 1
Distribution table of the link area of the grinding processing control system.
Station numberNameBit soft elementSoft elementMain site0Automatic control system for chamfering grindingM1000∼M1063D0∼D7Follow station1Automatic feeding system for chamfering millM1064∼M1127D10∼D172Automatic feeding system for face millM1128∼M1191D20∼D273Internal arc grinding automatic feeding systemM1192∼M1255D30∼D374Cylindrical grinding automatic feeding systemM1256∼M1319D40∼D475Automatic feeding systemM1320∼M1383D50∼D57It can be seen from the table that each subsystem can write its own bit soft elements (64 points) and word soft elements (8 bytes) in the operation link area to achieve the purpose of broadcasting information data. At the same time, the corresponding information can be obtained by reading the bit soft elements and word soft elements of other stations in the link area, thereby realizing data interaction [5, 12].


## 4. Communication Program Design

It can be seen from the above that there are 6 stations in the entire network of the grinding process control system. Now, take the automatic feeding system of the end-face mill as an example to illustrate its communication program design.The realization function of the automatic feeding system of the end-face grinder is to suck the product from the discharge position of the inner arc grinder. Then, turn it over to transform the product posture from the concave surface up to the convex surface up and then place it in the feeding position of the end-face grinding feeder. The control elements include four sets of servo motors, a set of rotating cylinders, two sets of vacuum suction cups, and the start and stop of the end-face grinder. The communication data includes bit soft elements with input state (X) 40 points and output state (Y) 40 points. Manual operation button has 56 points and other signals have 28 points. The word device has 80 bytes of parameter data register (D). The data register (D) of the current position, target position, and alarm information of the motor is 36 bytes. The timing of the data communication interaction is when the system starts; the master station downloads the data in the parameter data register to the slave station. When setting parameters, store the corresponding parameter data register to the corresponding register of the slave station. When operating the motor, write information such as the target position of the motor to the slave. The slave station uploads the input status, output status, manual operation and other bit soft elements, motor current position, alarm information, and other soft element data to the master station for processing and display. There are 5 slave stations, and the amount of data uploaded and downloaded from each slave station is similar. The data bit soft elements that can be operated by the master station and the slave station are only 64 points and 8 bytes of soft elements; this memory is not sufficient, which is obviously far from enough [13].From the perspective of communication nature, the process is nothing more than the download of data from the master station and the upload of data from the slave station [2, 14]. Combined with modular programming ideas, this paper proposes a two-way read-write module design mode. That is, the master station download is used by the master station write module and the slave station read module to complete the download of the master station data, and the slave station data upload is combined by the slave station write module and the master station read module to complete the slave station data upload. The master station and the slave station call the corresponding modules in real time as needed during their work. Therefore, it is defined that D0∼D1 are the current register numbers written into the master station, and D2∼D7 are the data of the 3 groups of registers corresponding to the register numbers in sequence. For example, if D0∼D1 are 200, write the contents of the D200∼D201 registers of the master station into D2∼D3. The contents of the D202∼D203 registers of the master station are written into D4∼D5. The contents of the D204∼D205 registers of the master station are written into D6∼D7. M1001 writes the flag bit of the automatic feeding system of the end-face grinder of the slave station 2 for the master station. That is to say, this bit indicates that the current D0∼D7 operation is writing to slave 2. In the same way, the register corresponding to the automatic feeding system of the slave station end-face grinder is assigned to define D20∼D21 to write the current register number of the master station. D22∼D27 are the data of the 3 groups of registers corresponding to the register number in sequence. For example, if D20∼D21 are 300, write the contents of the D300∼D301 registers of the master station into D22∼D23. The contents of the D302∼D303 registers of the master station are written into D24∼D25. The contents of the D304∼D305 registers of the master station are written into D26∼D27. M1128 is the slave station 2 to write the master station standard bit, that is, this bit is set to indicate that the current D0∼D7 operation is to write to the master station.The parameter download module needs to be executed when the master station starts or sets the parameters. The parameters that need to be written to slave station 2 are stored in the D400∼D479 registers, which are stored in the form of double bytes. After writing to slave station 2, it needs to be saved in the D200∼D279 registers. When M141 is set, the parameter download of slave 2 is started. First, preset the initial value of Z3 index register to K194 and then add K6 to Z3 every time you start writing; until Z3 is greater than 279, it means that all parameters have been written to reset M141 and stop writing. It can be seen that Z3 is K200 when writing for the first time; execute MOVP Z3 D0, DMOVP D200Z3 D2, DMOVP D202Z3 D4, and DMOVP D204Z3 D6 in order to write D400∼D405 into D2∼D7. Then, delay setting M1001 to ensure that the data of D0∼D7 are updated. When other slave stations receive M1001, they give up and do not process it. Only slave station 2 receives M1001 and starts to receive data. First, read the D0 data into the Z0 index register and then Z0 is 200. Then, execute DMOV D2 D0Z0, DMOV D4 D2Z0, and DMOV D6 D4Z0 to store the data of D0∼D7, that is, the data of D400∼D405 of the master station to D200∼D205, and then, set M1129. When the master station receives the M1129 setting signal, it appears that the slave station has already received the group of data. Then, reset M1001. The master station writes the slave station 2 flag bit, and the slave station resets M1129 after receiving the M1001 reset signal. This completes a set of data interactions. Then, the master station index register Z3 increments K6 to become K206, and the process of writing D406∼D411 data into the slave station D206∼D211 registers is started again. Repeat this way until all writing of the data in this segment is completed. The ladder diagram of the master station downloading parameters to the slave station is shown in Figure4, and the ladder diagram of the slave station receiving the master station downloading parameters is shown in Figure 5.Figure 4
The master station downloads the parameters to the slave station ladder diagram.Figure 5
Ladder diagram of downloading parameters from the master station.When the slave station 2 wants to upload data to the master station, it needs to execute the upload module. The upload data contains two parts: one part is the current parameter register content D200∼D279 and the other part is the current position of each axis, PLC input and output status, alarm information, and other data, which are sequentially stored in the status registers D290∼D309. The first part is executed when necessary, and the latter part is executed continuously under normal working conditions so that the current information of slave station 2 can be displayed on the touch screen in real time through the master station as much as possible. Therefore, set M1133 as the switch flag. If M1133 is set, the upload parameter register content will be executed, and M1133 will automatically reset after the transfer is completed. When M1133 is reset, upload the contents of the status register. The specific working process of the uploading module is basically similar to the downloading process of the master station, so we will not repeat it.It is worth noting that because the touch screen of the master station needs to operate the slave station actions, the number of operation buttons is relatively large. Therefore, another program is designed to download and refresh the button state to meet the functional requirements. Start the buttons for operating slave 2 on the touch screen from M894 and define them in sequence. Continuously scan and execute D<> K8M896 D64 to determine whether the state of the 64 intermediate relays starting from M894, that is, the button has changed. If there is a change, set the flag bit, execute DMOV K8M896 D64 at the same time, and store the button state in the double-byte register D64. Then, write D64∼D65 into D4∼D5 and then set M1062 to notify slave station 2 that the button status has changed. After receiving the M1062 setting signal, the slave station 2 reads the data of D4∼D5 and analyzes the data accordingly to determine which button is acting and react accordingly.It can be seen from the above that the link area is too small and the transmission information is limited; we should improve on this shortcoming in order to achieve actual expansion, and its core is time-sharing multiplexing; that is, the same set of data registers can transmit different data under different conditions at different times, such as the soft elements D0∼D7 controlled by the master station. It can download data from one to five hundreds of parameter registers of the slave station and can also set the target position and running speed of dozens of servo motors in the slave station in pseudoreal time. At the same time, button operations can be performed on hundreds of actions of each slave. The fundamental problem is to operate the link register in time intervals and, at the same time, realize operation selection and handshake interaction with the corresponding bit soft elements. Priority settings are performed in time-sharing multiplexing to determine when there are data transmission requirements at the same time and execute them in order, from the highest to the lowest, to avoid data conflicts or confusion. In this way, the PLC communication program is designed and the link area is improved. Use the index register to store the register number and register data, respectively, in the soft element of the link area, and cooperate with the operation of the corresponding bit soft element to carry out the handshake operation. In this way, the link area of limited data can be used to achieve more data interaction.


## 5. Conclusion

Based on the PLC link network communication method, this paper proposes an improved PLC communication program design method. The time-sharing multiplexing method is adopted, the soft elements in the link area are used for register address and data transmission, and the bit soft elements in the link area are used as interactive handshake signals. In this way, a large-scale data transmission interaction between the master and slave stations is completed, and the control system of the drum brake pad automatic processing production line can be realized, and good results have been achieved. After nearly a year of long-term operation, the data interaction performance is stable, and the delay caused by the time-sharing interaction is extremely short and does not affect the operation, and the overall effect is good. This proves that this design method has high reliability, stability, and scalability in application and has certain reference significance and reference value in PLC distributed link network control systems such as automated production lines.



---

*Source: 9788974-2021-09-26.xml*