Implementation of multi PLC networking system base

2022-10-03
  • Detail

The realization of multi PLC group system based on CAN bus in textile factory

1 introduction

at present, most common PLC models do not have the communication function interface of integrated field bus can bus, so it is inconvenient to realize the control network of multiple PLCs based on CAN bus. With the development of application technology, industry often needs n PLCs to complete the integrated control of a system. At this time, the original centralized control of a single PLC control scheme is beyond its power, and the integration engineering requirements of PLC network also came into being

this paper presents a PLC network scheme based on field bus can bus, which can realize remote configuration and data communication for multi connected PLC, and realize good system operation performance on the basis of low hardware cost. This scheme not only gives full play to the communication characteristics of field bus can bus: real-time, reliable, high-speed, long-distance, easy maintenance, etc., but also organically combines field bus technology with centralized control technology. The connected PLC network can form a DCS system with superior performance; Users can remotely monitor and change the program or state of any PLC on the same main controller (PC)

2 two ways to establish PLC network

general PLC generally provides 1 ~ 2 RS-232 or RS-485 communication ports for communication with other control equipment; These communication ports support limited communication protocols to realize the communication and configuration of PLC equipment. This project uses PLC's own communication port to expand it to be able to connect with multiple devices, and realize multiple PLC networks based on field bus can bus. According to the different main controllers in the network, the PLC network is divided into the following ways: multiple PLCs are connected, each PLC has equal status, and the HMI human-machine interface can be extended; Multiple PLCs are connected, and one industrial PC is used as the main controller and operation interface. This paper mainly discusses two methods of PLC group based on RS-232 or RS-485 communication port

2.1 PLC serial connection

through rs-232/rs-485 to can bus off for signal conversion, PLC has a CAN bus communication interface. Many PLC with CAN bus communication interface are connected with each other, that is, the PLC network can be established. Each RS-232/RS-485 to can bus switch connected to the PLC unit can set an independent device ID number with a length of 11 or 29 bits, which is used as the address of the PLC unit

through the PLC network established in the above way, any PLC can actively initiate data communication, and the hardware automatic arbitration function is turned off by the CAN bus to ensure that the data of each communication is not lost; The number of PLC in the network is unlimited, hundreds or thousands of PLC can be connected in the same field bus can bus network. At the same time, HMI man-machine interface with CAN bus communication interface can be connected in PLC network

2.2 multiple PLCs are connected in parallel with industrial control PCs

industrial control PCs are inserted with PCI can cards (such as Advantech's pci1680, Zhou Ligong's pci5110, etc.), which can form a CAN bus network. Through the rs-232/rs-485 to can bus converter connected in the CAN bus network, with the help of the "virtual serial port" software supporting the CAN bus network, up to 2047 standard serial communication ports are established, so as to connect up to 2047 serial networks. That is, up to 2047 PLC devices are connected to an ordinary twisted pair, and the industrial PC accesses the PLC devices connected to the CAN bus network, which is completely consistent with the operation standard serial port. This way can give full play to the role of industrial PC, and the communication efficiency is relatively high. It is the mainstream direction of general PLC network construction. This paper adopts this scheme to set up PLC network. The system structure is shown in Figure 1

Figure 1 multiple PLCs are connected in parallel with industrial PC

3 hardware composition and connection of PLC network

to establish PLC network, in addition to PLC equipment, it is also necessary to establish field bus can bus network equipment, mainly including RS-232 to can bus switch, PCI can interface card, etc

rs-232 to can bus converter can be easily connected to the RS-232 standard communication port of PLC equipment, so that PLC equipment has the ability to communicate with field bus can bus network. The converter can support PLC devices with different communication protocols through Modbus protocol conversion. For PLC equipment that only integrates rs-485/422 communication ports, RS-485 to can bus converter can be selected. RS-232 to can converter and RS-485 to can converter readers can design by themselves or buy products that are mature in the current market, such as Adam module of Advantech and intelligent conversion module of Zhou Ligong

the industrial control PC can be equipped with a field bus can bus communication interface by inserting a PCI can interface card, thus becoming a main function node in the CAN bus network. According to the different connection mode with PC, PC can interface card can be divided into many different types. The common models include PCI can interface card, ISA can interface card, PC104 can interface card, usbcan interface card, Ethernet to can interface card, etc

The PCI can interface card is generally provided with a CAN bus tester. The main part of the tester includes hydraulic system, host, hydraulic control cabinet and microcomputer control system, API development routines, OPC server software, etc. Using "virtual serial port server" software, we can develop software projects based on serial port communication, and build PLC network based on CAN bus

4 Mitsubishi Siemens can network integration case

4.1 principle design

in the printing and dyeing control system of a printing and dyeing factory, there are two Swiss Busai 5V flat printing machines, three Taiwan Qizheng flat printing machines, two Japanese Dongsheng flat printing machines and two German MBK round printing machines. The main controllers of these equipment are Siemens s and Mitsubishi FX series PLC. In order to enable the printing and dyeing control system of the printing and dyeing factory to monitor and control on one set, a single PLC is used to collect and control the signals of field equipment. Because the working points of each field PLC are far away, it is impossible for the industrial computer PC to realize the separate cable connection of each PLC equipment. Therefore, connect each PLC device through the field bus can bus network to form a PLC network in a regional scope. 1. Variable frequency system tension testing machine: adopt the variable frequency motor control system, so as to realize PLC Remote Maintenance and real-time data monitoring, which can not only greatly improve the management efficiency of the system, but also effectively reduce the network construction cost

in PL type of each flat printing machine: △ F - frequency resolution (Hz) C the device is integrated with a rs-4852 serial communication port, which is connected to the field bus can bus network through a can to RS-485 converter. The industrial computer PC has a built-in PCI can interface card, the model is pci-1680 interface card, which can make the industrial computer become a node in the CAN bus network, and can manage nine flat printing machines at the same time

plc serial communication protocol implementation, different manufacturers, PLC serial communication protocol is different, this paper takes the s used in this project as an example to illustrate its communication method. S series PLC is equipped with RS-485 standard serial interface, which can realize the connection of the following four networks:

(1) SIMATIC s network (PPI Protocol)

(2) user programmable interface protocol (free port mode) adopts programmable free port communication mode

(3) PROFIBUS DP network

4.2 system communication

this project adopts the mode of free port communication. The special registers and related bits related to the free port mode:

(1) control word register smb30: the communication mode of SPLC is set by smb30. When mm=01, PLC works in the free port mode

(2) communication receiving character buffer Smb2: Smb2 is a transient register used to store the current characters received in the free port communication mode. In the next step, the user should take the contents from here and move the received characters from Smb2 to the receiving buffer one by one through programming control

(3) communication check result flag bit smb3.0: PLC checks the received data according to the parity check method specified in smb30. If the check is wrong, PLC will automatically set smb3.0 to 1, sm3.0=0 means the parity check is correct. According to this flag, you can decide whether to choose the current information or not, and you can also send this error bit to the other party in case of error, so as to ask it to resend

(4) working mode flag bit sm0.7: s series PLC can only communicate in free port mode when it is in run mode, and can only communicate in PPI mode when it is in stop mode. When the PLC is in the run mode, sm0.7=1, otherwise sm0.7=0, so the free port communication can be turned on or off by judging the state of sm0.7

(5) transmitter empty flag sm4.5 and receiving and sending instructions: SPLC has special sending instructions: XMT table port table is the number of bytes of sent data, that is, the data length, with a maximum of 225; Port specifies the communication port, which must be 0 in free port mode. When the data information is being sent, the special memory bit sm4.5=0. When the transmission is completed, sm4.5=1. Therefore, the post transmission processing can be carried out by judging the state of sm4.5, or it can be directly processed with the transmission interrupt. Cpu215 cpu216 also provides receive control instructions: RCV table port works with smb86 smb94 SMB 186 SMB 194 registers to change (initialize or terminate) receive information

When the PLC serial communication program is executed, the state of sm0.7 should be checked at the beginning of each scanning cycle. If the PLC is in the run mode, that is, sm0.7=1, open the free port mode and set other relevant parameters such as baud rate and parity, otherwise the free port mode is invalid

5 Conclusion

the implementation of multiple PLC group system based on CAN bus introduced in this paper, in the actual operation of the system, the stability and anti-interference ability of field bus can bus are fully reflected. The project does not need to change the original field equipment control platform. The existing control equipment can be seamlessly embedded into the advanced field bus network to form a new generation of textile automation integrated network system, which provides a field information automation platform for textile engineering MES and ERP. The scheme is invested at a lower cost to improve the long-span of on-site automation network. It has a good application prospect

Copyright © 2011 JIN SHI