CN115174315A - Gateway system and method supporting multi-protocol PLC communication - Google Patents

Gateway system and method supporting multi-protocol PLC communication Download PDF

Info

Publication number
CN115174315A
CN115174315A CN202210798122.4A CN202210798122A CN115174315A CN 115174315 A CN115174315 A CN 115174315A CN 202210798122 A CN202210798122 A CN 202210798122A CN 115174315 A CN115174315 A CN 115174315A
Authority
CN
China
Prior art keywords
communication
plc
protocol
module
plcs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210798122.4A
Other languages
Chinese (zh)
Inventor
沈国强
刘奇
吴欣
何磊
仲峥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN202210798122.4A priority Critical patent/CN115174315A/en
Publication of CN115174315A publication Critical patent/CN115174315A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C3/00Registering or indicating the condition or the working of machines or other apparatus, other than vehicles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25204Translate between different communication protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Automation & Control Theory (AREA)
  • Communication Control (AREA)

Abstract

The invention provides a method for supporting multi-protocol PLC communication, which does not directly realize address exchange among PLCs, but encapsulates variable information in PLCs with different protocols into an intermediate protocol in a communication protocol middleware mode, and indirectly implements communication. The invention develops a set of gateway system based on the method, and the gateway system is connected with the PLC equipment in an Ethernet mode, so that data communication among the PLCs with different protocols can be realized through more convenient parameter configuration, and the requirement of cooperative control of a plurality of PLCs is met.

Description

Gateway system and method supporting multi-protocol PLC communication
Technical Field
The invention relates to the field of PLC communication, in particular to a gateway system and a method for supporting multi-protocol PLC communication.
Background
The PLC (programmable logic controller) is an industrial controller, is widely applied to various fields of modern industrial automation control due to the advantages of strong performance, high reliability, strong anti-interference capability, convenience in operation and the like, and serves as a control hub of automation systems such as automation equipment and an automation production line.
In a complete automatic control system, a single PLC may not meet the control requirement due to performance or function limitation, and at the moment, a plurality of PLCs are required to work together to realize cooperative control. In such a scenario, data interaction and communication between PLCs become a core problem to be solved. Among existing communication schemes, ethernet communication is favored by the industry due to its characteristics of large communication data volume, high communication rate, and the like, and is now a mainstream communication method. For the PLCs of the same brand, manufacturers generally provide a communication scheme based on an own ethernet protocol, but when PLC communications of different brands and different protocols are involved, a simpler communication method does not exist at present because of inconsistency of communication protocols among the PLCs.
Disclosure of Invention
In view of the problems in the prior art, the invention provides a method for supporting multi-protocol PLC communication, which does not directly realize address exchange among PLCs, but encapsulates variable information in PLCs with different protocols into an intermediate protocol in a communication protocol middleware mode, and indirectly implements communication. The invention develops a set of gateway system based on the method, and the gateway system is connected with the PLC equipment in an Ethernet mode, so that data communication among the PLCs with different protocols can be realized through more convenient parameter configuration, and the requirement of cooperative control of a plurality of PLCs is met.
The invention provides a gateway system supporting multi-protocol PLC communication, comprising: the PLC variable reading and writing module, the PLC communication module and the operation configuration module;
the PLC variable reading and writing module is based on a TCP protocol and is used for reading and writing variable information in PLCs with different communication protocols and establishing Socket connection with the PLCs;
the PLC communication module is used for realizing master-slave communication between PLCs and is directly coupled with the PLC variable read-write module;
the PLC communication module is a Client/Server architecture;
the operation configuration module is a Web application developed based on Java and JavaScript languages and constructed based on a SpringBoot framework, wherein the front-end configuration page is constructed by adopting the technologies of Vue.
The system is mainly developed by using Java language, can well run in a Linux system or a Windows system, and has good cross-platform performance. The system can be deployed on a small industrial personal computer and a Linux development board, and a hardware system is transformed into a gateway device. The PLC communication module takes OPC UA protocol as a basis, indirectly reads, writes and modifies variable information in the PLC through modification of an OPC UA server and an OPC UA client to a node value, and realizes master-slave communication between the PLCs. And the front-end configuration page in the operation configuration module is constructed by adopting technologies such as Vue. The main function of the system is to facilitate the use and configuration of the whole system by developers, including establishing connection with the PLC, establishing and mapping communication nodes, and starting communication services.
The invention also provides a method for supporting multi-protocol PLC communication, which comprises the following steps:
the method comprises the following steps: determining the model and the IP address of the PLC, and determining the variable address and the variable mapping relation of the PLC needing to be communicated according to the field process requirement and the PLC program;
step two: determining a protocol class required for TCP communication with the PLC according to the model of the PLC, instantiating the protocol class and establishing socket connection;
step three: the communication protocol middleware respectively creates a communication master station and a communication slave station for the PLC in the communication chain, and respectively creates communication nodes for the communication master station and the communication slave station according to the communication variable information determined in the step one;
step four: and adding a variable mapping relation for the communication master station and the communication slave station created in the step three, and ensuring that the data types of the nodes mapped at the two ends are the same and the input and the output correspond to each other according to the variable mapping relation determined in the step one.
Preferably, the second step further comprises the following substeps:
and a first substep: the PLC variable reading and writing module receives configuration data including a PLC model and an IP address;
and a second substep: inquiring a corresponding communication protocol in a database according to the ID of the PLC model;
and a second substep and a third substep: instantiation is carried out according to the inquired communication protocol type and the obtained IP address;
and the substep two and four: and establishing socket connection objects of PLCs with different protocols, and reading and writing data through write () and read () in the connection objects.
Preferably, the third step further comprises the following substeps:
the substep III is one: establishing an OPC UA server for a PLC in a communication chain, packaging communication variable information of the PLC into a node form in an OPC UA address space, then starting the OPC UA server by taking an address space object as a parameter, wherein the PLC is a communication master station in the communication chain;
and a third substep and a second substep: and establishing OPC UA clients for the rest PLCs in the communication chain, instantiating an OPC UA client object with a subscription function, and calling a data read-write module of the PLC by using the OPC UA clients to read and write variables.
The invention has the substantive characteristics that: the communication method supporting the multi-protocol PLC is strong in universality, and the PLCs with the same or different protocols can realize the communication function through the system; the method is non-invasive, and the PLC program does not need to be modified in the communication process; the flexibility is high, the two PLCs do not communicate directly, but are decoupled in a communication protocol middleware mode, and communication node information and a node mapping relation can be changed at any time according to requirements.
The gateway system equipment supporting multi-protocol PLC communication is convenient and fast to expand, and the PLC variable read-write module adopts a plug-in development mode, and can support new PLC only by expanding and developing the module. The system has rich functions, and a core module of the system not only can realize communication between PLC hardware but also can read variable information in the PLC based on the OPC UA protocol based on a C/S framework of the OPC UA protocol, thereby realizing the collection and monitoring of the running state information of field equipment or a production line, realizing the fusion of OT and IT by virtue of the OPC UA protocol, and providing data support for edge computing and cloud computing.
Drawings
FIG. 1 is a system architecture diagram of a gateway system implementing communications in the present invention;
FIG. 2 is a diagram of the steps of a communication method of the present invention;
FIG. 3 is a flow chart of the PLC variable read-write module establishing connection according to the PLC model;
fig. 4 is a flow chart of the PLC communication module implementing communication;
FIG. 5 is a gateway system connection test and communication node configuration diagram;
fig. 6 is a communication service setup and communication node map.
Detailed Description
The technical solution of the present invention is further specifically described below by way of specific examples in conjunction with the accompanying drawings.
Example 1
As shown in fig. 1, the overall architecture diagram for communication using the gateway system is divided into a system operating medium, an operation configuration module, a PLC variable read-write module, and a PLC communication module. As shown in fig. 2, which is a step diagram of the communication method of the present invention, the communication method of the present invention will be described in detail below with reference to the above modules.
1. And inputting the models and IP addresses of the PLCs with the same or different protocols to be communicated in the operation configuration module, and performing connection test of the PLCs.
2. As shown in fig. 3, it is a flow chart for the PLC variable read-write module to establish connection according to the PLC model. Because the operation configuration module is directly coupled with the PLC variable reading and writing module, the PLC variable reading and writing module can receive configuration data transmitted from the front end, and the module can search a protocol class corresponding to the PLC in the MySQL database according to the ID of the PLC model, for example, siemens PLC corresponds to Siemens Tcp class, mitsubishi PLC corresponds to Melsec FxTcp class, xinjie PLC corresponds to XinJeTcp class and the like. After finding out the corresponding protocol class, instantiating the protocol class by taking the PLC model and the IP address transmitted from the front end as parameters, namely establishing socket connection objects with PLCs of different protocols, and reading and writing specific data in the PLCs by methods such as write () and read () in the connection objects.
3. After the PLC variable read-write module successfully establishes connection with PLCs with different protocols, according to the communication method disclosed by the invention, a communication protocol middleware needs to be introduced to realize the communication between the two PLCs. The communication protocol middleware is a PLC communication module realized based on the OPC UA protocol and is also a core module of the whole method, the module is mainly realized based on a Client/Server architecture of the OPC UA protocol, and an OPC UA Client can browse and subscribe nodes in an OPC UA Server. As shown in fig. 4, first, the module establishes an OPC UA server for a PLC in the communication chain, that is: encapsulating the communication variable information of the PLC into a node form in an OPC UA address space, then starting an OPC UA server by taking an address space object as a parameter, wherein the PLC is a communication master station in a communication chain; this module will then establish OPC UA clients for the remaining PLCs, i.e.: and instantiating an OPC UA client object with a subscription function, calling a data read-write module of a PLC (programmable logic controller) by using the OPC UA client to read and write the specific variable, wherein the communication node of the slave station is the specific variable, and the PLCs are communication slave stations in a communication chain.
4. After the PLC communication module establishes the communication master station, the communication slave station and the communication node, the communication between the two PLCs can be indirectly realized through the change of the OPC UA server and the OPC UA client to the node information. As shown in fig. 4, the solid line arrows represent a process of writing data from the master PLC to the slave PLC, and the dotted line arrows represent a process of writing data from the slave PLC to the master PLC, and the more detailed communication flow is as follows:
(1) when the variable information in the master station PLC is changed, the output node information in the OPC UA server is changed, and at the moment, when the UaMonitoredItem (monitor object) of the OPC UA client monitors that the node data is changed, a callback function is activated, extracts the variable information stored in the changed node information, calls a PLC data read-write module, and writes the data into the slave station PLC.
(2) And a real-time background thread is established, and the OPC UA client circularly calls a slave station PLC data read-write module in the thread to continuously write data into an input node of the OPC UA server. Therefore, when the variable information in the slave PLC is changed, the node information of the OPC UA server is also changed, and the changed data is written into the master PLC.
By the method, the exchange of variable information among the PLCs with different protocols is completed, and the communication among the PLCs is indirectly realized.
Taking an automatic control system of a manipulator material taking and placing module of certain automatic equipment as an example, the gateway system is deployed on a small industrial personal computer to realize the communication method in the invention, and the following concrete implementation steps are carried out.
The method comprises the following steps: respectively inserting a PLC with a Siemens S7-200Smart model and a PLC with a Xinjie XD5E-60T6-E model into an Ethernet port in an industrial personal computer; starting an industrial personal computer, and setting the static IP addresses of the two network ports to be in the same network segment with the IP address of the PLC; and then, connecting the PC for configuration with the industrial personal computer by using a network cable, and still ensuring that the static IP of the two devices is in the same network segment, wherein the static IP of a network port of the industrial personal computer connected with the PC is set to be 192.168.3.1.
Step two: as shown in FIG. 5, when a Chrome browser is opened in the PC, the website bar inputs http:// 192.168.3.1. In the system, the model of the PLC is selected, the IP address of the PLC is filled, and the connection between the system and the PLC is tested. At this time, the PLC variable read-write module searches a Siemens Tcp class corresponding to S7-200Smart and a XinJeTcp class corresponding to XD5E-60T6-E, instantiates the two cases, and namely establishes connection with the socket of the PLC.
Step three: after the connection is successful, as shown in fig. 5, variables M20.0, M20.1, V20.0, V20.1, VD20, and VD32 in S7-200Smart are created as communication nodes in the Master node list and added to the node manager Master 01; variables M110, M111, M100, M101, D10, D18 in XD5E-60T6-E are created as communication nodes in the Slave node list and added to the node manager Slave 01. At the moment, the PLC communication module takes S7-200Smart as a communication master station and XD5E-60T6-E as a communication slave station, and communication nodes corresponding to the master station and the slave station are created.
Step four: as shown in fig. 6, in the communication service setting, OPC UA server parameters of the master PLC are set. And then adding the mapping relation between the communication node of the PLC master station and the communication node of the PLC slave station in the node mapping list. When the mapping relation is added, firstly, according to actual requirements, secondly, the data types of two mapped nodes are ensured to be the same, and input and output are correctly corresponding. After the corresponding parameters are set, the communication service can be started, and the multi-protocol PLC communication is realized. After the communication service is started, an OPC UA server link is automatically generated, and variable information in the PLC is acquired based on an OPC UA protocol through the link to acquire the running state of the equipment.

Claims (4)

1. A method of supporting multi-protocol PLC communications, comprising the steps of:
the method comprises the following steps: determining the model and the IP address of the PLC, and determining the variable address and the variable mapping relation of the PLC needing to be communicated according to the field process requirement and the PLC program;
step two: determining a protocol class required for TCP communication with the PLC according to the model of the PLC, instantiating the protocol class and establishing socket connection;
step three: the communication protocol middleware respectively creates a communication master station and a communication slave station for the PLC in the communication chain, and respectively creates communication nodes for the communication master station and the communication slave station according to the communication variable information determined in the step one;
step four: and adding a variable mapping relation for the communication master station and the communication slave station created in the step three, and ensuring that the data types of the nodes mapped at the two ends are the same and the input and the output correspond to each other according to the variable mapping relation determined in the step one.
2. The method according to claim 1, wherein the second step further comprises the following sub-steps:
and the second substep is as follows: the PLC variable reading and writing module receives configuration data including a PLC model and an IP address;
and a second substep: inquiring a corresponding communication protocol in a database according to the ID of the PLC model;
and a second substep and a third substep: instantiating according to the inquired communication protocol type and the acquired IP address;
and the substep two and four: and establishing socket connection objects of PLCs with different protocols, and reading and writing data through write () and read () in the connection objects.
3. A method according to claim 1 or 2, characterized in that said step three further comprises the following sub-steps:
the substep III is one: establishing an OPC UA server for a PLC in a communication chain, packaging communication variable information of the PLC into a node form in an OPC UA address space, then starting the OPC UA server by taking an address space object as a parameter, wherein the PLC is a communication master station in the communication chain;
and a third substep and a second substep: and establishing OPC UA clients for the rest PLCs in the communication chain, instantiating an OPC UA client object with a subscription function, and calling a data read-write module of the PLC by using the OPC UA clients to read and write variables.
4. A gateway system supporting multi-protocol PLC communication, comprising: the PLC variable reading and writing module, the PLC communication module and the operation configuration module;
the PLC variable reading and writing module is based on a TCP protocol and is used for reading and writing variable information in PLCs with different communication protocols and establishing Socket connection with the PLCs;
the PLC communication module is used for realizing master-slave communication between PLCs and is directly coupled with the PLC variable read-write module;
the PLC communication module is a Client/Server architecture;
the operation configuration module is a Web application developed based on Java and JavaScript languages and constructed based on a SpringBoot framework, wherein a front-end configuration page is constructed by adopting technologies such as Vue.
CN202210798122.4A 2022-07-08 2022-07-08 Gateway system and method supporting multi-protocol PLC communication Pending CN115174315A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210798122.4A CN115174315A (en) 2022-07-08 2022-07-08 Gateway system and method supporting multi-protocol PLC communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210798122.4A CN115174315A (en) 2022-07-08 2022-07-08 Gateway system and method supporting multi-protocol PLC communication

Publications (1)

Publication Number Publication Date
CN115174315A true CN115174315A (en) 2022-10-11

Family

ID=83491365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210798122.4A Pending CN115174315A (en) 2022-07-08 2022-07-08 Gateway system and method supporting multi-protocol PLC communication

Country Status (1)

Country Link
CN (1) CN115174315A (en)

Similar Documents

Publication Publication Date Title
CN108847979B (en) Self-adaptive configuration system and method based on SCADA
US20100250719A1 (en) Universal Network Adapter for Industrial Control Networks
CN106980560B (en) ICD database based multi-bus protocol testing and simulating method and platform
CN112115604B (en) Combined simulation method and system for Modelica model and Simulink model and electronic equipment
CN113039498A (en) Method for commissioning field devices in an industrial system network
CN113835799A (en) Field device configuration tool
CN112887356A (en) System for sharing memory data distribution service and operation method thereof
WO2022156316A1 (en) Configuration method and system supporting heterogeneous environment
CN114513404B (en) Method and device for configuring time-sensitive network and computer-readable storage medium
JP2001209407A (en) Simulator for executing plc program
US20220030090A1 (en) Selective address space aggregation
US9391797B2 (en) Dynamic host profiles for option modules
Jacoby et al. FA 3 ST Service–An Open Source Implementation of the Reactive Asset Administration Shell
CN113422719A (en) Configuration system and configuration method of protocol conversion gateway and protocol conversion gateway
CN115174315A (en) Gateway system and method supporting multi-protocol PLC communication
CN111147510A (en) Data acquisition system and method based on SOA reflection factory architecture
Cabral et al. Native OPC UA handling and IEC 61499 PLC integration within the arrowhead framework
CN117234146B (en) Cloud PLC multi-protocol I/O equipment remote control method and system
CN115297012B (en) Offline testing method and device of SDN controller, controller and medium
CN115037639B (en) Processing method, device, equipment and medium of edge data platform interface information
CN115086443B (en) Communication protocol conversion method and system
CN117421916B (en) Method for constructing digital twin system of production line of mobile phone assembly workshop
Thramboulidis et al. Field device specification for the development of function block oriented engineering support systems
Kostenko Real-time communication between robot PLC and PC over Ethernet-based protocols
Ramesh et al. Case study on Integrating Legacy Devices in Industry 4.0 framework using OPC UA

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination