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

This paper mainly introduces an improved PLC communication program based on PLC link network communication. Read and write corresponding production data at diﬀerent 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.

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]. e 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. e 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. e link area contains not only the data sent by this PLC but also the data received from other PLCs. erefore, 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]. e 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 Figure 1. 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. e details are shown in Figure 2 [9].

Control System Analysis
Drum brake pad processing automatic line is an automatic production line after transformation and upgrading. is 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. e whole production line can be divided into front and rear parts. e front part is for grinding and the back part is for drilling. ere 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) e 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. e front part is for grinding and the back part is for drilling. erefore, its control system is also divided into two parts, grinding processing and drilling processing, which exchange data with each other through communication.
(3) e PLC selection of each station is based on actual needs. e servo control of 2 axes and below adopts Mitsubishi FX3UPLC and the 2-4 axes adopts Mitsubishi FX5U.
(4) e RS485 networking mode is adopted between PLCs. e 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. e system control block diagram is shown in Figure 3. Take the previous grinding processing control system as an example. e 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. e link area distribution is shown in Table 1.
It 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].

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. e 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. en, turn it over to transform the product posture from the concave surface   Mobile Information Systems information of the motor is 36 bytes. e 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. e 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. ere are 5 slave stations, and the amount of data uploaded and downloaded from each slave station is similar. e 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.
at 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. e master station and the slave station call the corresponding modules in real time as needed during their work. erefore, 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. e contents of the D202∼D203 registers of the master station are written into D4∼D5. e 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.
at 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. e contents of the D302∼D303 registers of the master station are written into D24∼D25. e 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. e parameter download module needs to be executed when the master station starts or sets the parameters. e 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   Internal arc grinding automatic feeding system M1192∼M1255 D30∼D37 4 Cylindrical grinding automatic feeding system M1256∼M1319 D40∼D47 5 Automatic feeding system M1320∼M1383 D50∼D57 to write D400∼D405 into D2∼D7. en, 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. en, 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. en, reset M1001. e master station writes the slave station 2 flag bit, and the slave station resets M1129 after receiving the M1001 reset signal. is completes a set of data interactions. en, 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. e ladder diagram of the master station downloading parameters to the slave station is shown in Figure 4, and the ladder diagram of the slave station receiving the master station downloading parameters is shown in Figure 5.
When the slave station 2 wants to upload data to the master station, it needs to execute the upload module. e 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. e 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.
erefore, 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. e 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. erefore, 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. en, 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   e 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.

Conclusion
Based on the PLC link network communication method, this paper proposes an improved PLC communication program design method. e 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. is 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.

Data Availability
e data that support the findings of this study are available from the corresponding author upon reasonable request.