An OPC UA dynamic deployment method for field devices

By automatically generating OPC UA server nodes on the upper computer platform, the dynamic deployment complexity of field devices is solved, efficient OPC UA deployment and node updates are achieved, and the communication process of field devices is simplified.

CN116088867BActive Publication Date: 2025-08-29HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211723827.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-08-29
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

In the industrial control field, OPC UA deployment of field devices is complex and difficult to update dynamically, especially when the information model changes, requiring recompilation and downloading of programs, which makes deployment difficult.

Method used

By defining variables on the upper computer compilation platform and automatically generating the OPC UA server node, the address mapping table is used to dynamically deploy between the programmable controller PLC and the field device, including steps S1 to S7, to realize address mapping and communication, and simplify the deployment process.

Benefits of technology

It realizes efficient and dynamic deployment of OPC UA on-site devices, simplifies deployment complexity, improves deployment efficiency, and supports simultaneous updates of multiple nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116088867B_ABST
    Figure CN116088867B_ABST
Patent Text Reader

Abstract

The present invention discloses an OPC UA dynamic deployment method for field equipment, which includes at least the following steps: step S1: the field equipment sets a communication module and establishes a connection with a programmable logic controller (PLC); step S2: the variables and program logic of the field equipment are defined in a host computer according to application requirements and encapsulated into an XML format file; step S3: the programmable logic controller (PLC) obtains the XML format file obtained in step S2; step S4: according to an address mapping table, an OPC UA server is created on the programmable logic controller (PLC) and corresponding nodes are added; step S5: according to the address mapping table, the programmable logic controller (PLC) communicates with the field equipment to create an OPC UA server in the field equipment and add corresponding nodes; step S6: according to the address mapping table, an OPC UA client is created on the programmable logic controller (PLC) to establish communication with the field equipment and monitor nodes in the field equipment server; step S7: if a node in the address mapping table changes, data synchronization is performed through communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial control, and in particular relates to an OPC UA dynamic deployment method for field equipment. Background Art

[0002] In the field of industrial control, automation systems interact with the real physical world through the use of sensors and actuators. Automatic control tasks are performed by programmable controllers, while some host devices provide manual oversight. While communication between controllers and host devices is often based on state-of-the-art protocol stacks, connections to field devices are often still based on fieldbus systems. This leads to the use of gateways between different parts of the automation system, which carries the risk of information loss.

[0003] The OPC UA protocol is a suitable technology for unifying field device communications. However, the development and application of OPC UA technology is difficult when embedded field devices have limited code capacity. Furthermore, changes to information models during field device deployment often require recompiling and downloading the program, making it difficult to deploy OPC UA clients and servers within these devices.

[0004] Therefore, in view of the technical defects of the existing technology, it is necessary to propose a technical solution to solve the technical problems of the existing technology. Summary of the Invention

[0005] The purpose of the present invention is to overcome the shortcomings of the existing technology and adapt to practical application needs. It provides an OPC UA dynamic deployment method for field devices. The method can define or change variables on the host computer compilation platform and automatically generate or update nodes in the OPC UA server. This completes the address mapping and communication from the programmable controller (PLC) to the field device, simplifies the deployment complexity of the OPC UA server and client of the field device, and improves the deployment efficiency of OPC UA.

[0006] In order to solve the technical problems existing in the prior art, the technical solutions of the present invention are as follows:

[0007] An OPC UA dynamic deployment method for field devices includes at least the following steps:

[0008] Step S1: The field device sets up a communication module and establishes a connection with the programmable logic controller (PLC) to perform data transmission according to a specific communication protocol;

[0009] Step S2: The host computer defines the variables and program logic of the field device according to the application requirements and encapsulates them into an XML format file;

[0010] Step S3: The programmable logic controller (PLC) obtains the XML file obtained in step S2 and parses it, encapsulating the relevant information of the variables into an address mapping table;

[0011] Step S4: According to the address mapping table obtained in step S3, create an OPC UA server on the programmable logic controller (PLC) and add corresponding nodes;

[0012] Step S5: According to the address mapping table obtained in step S3, the programmable logic controller (PLC) communicates with the field device to create an OPC UA server in the field device and add a corresponding node;

[0013] Step S6: Based on the address mapping table obtained in step S3, an OPC UA client is created on the programmable logic controller (PLC) to establish communication with the field device and monitor the nodes in the field device server.

[0014] Step S7: If the address mapping table node changes, data synchronization is performed through communication.

[0015] As a further improvement, in step S7, if the number of nodes in the address mapping table increases or decreases, the OPC UA server on the programmable controller (PLC) also increases or decreases the corresponding nodes and communicates with the field device through the communication module to synchronize the node changes on the OPC UA server of the field device.

[0016] If the node value in the OPC UA server on the programmable controller (PLC) changes, the OPC UA client on the programmable controller (PLC) initiates communication with the OPC UA server on the field device to synchronously update the node value change.

[0017] If the node value in the OPC UA server of the field device changes, the OPC UA client on the programmable controller PLC monitors the changed node on the OPC UA server of the field device, and the node value change is synchronously updated on the OPC UA server of the programmable controller PLC.

[0018] As a further improvement, in step S2, address mapping is completed through variable definition and program writing according to the variables to be controlled by the field device and the variables of the programmable controller.

[0019] As a further improvement, in step S3, the address mapping table includes at least the actual address of the variable in the field device, the actual address of the variable in the programmable logic controller (PLC), the OPCUA node variable name, the node ID, the node data type, and the node namespace.

[0020] As a further improvement, the communication between the programmable logic controller (PLC) and the field device at least includes:

[0021] Generate and send data frames in the frame format according to the agreed protocol;

[0022] After receiving the data frame, the field device parses the data frame and obtains the node information to be operated, including the node variable name, node ID, node data type and node namespace, as well as the actual address of the variable bound to the node;

[0023] Send node information to the OPC UA server of the field device.

[0024] Compared with the deployment of on-site embedded devices in the prior art, the present invention has at least the following beneficial effects:

[0025] The technical solution of the present invention enables dynamic OPC UA deployment from programmable controllers (PLCs) to field devices. By defining or modifying variables on the host computer's compilation platform, nodes in the OPC UA server are automatically generated or updated, completing address mapping and communication between the PLC and field devices, thereby improving OPC UA deployment efficiency. The custom protocol used in the present invention offers excellent scalability and enables simultaneous updates of multiple nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a flowchart of an OPC UA dynamic deployment method for field devices according to the present invention.

[0027] Figure 2 A schematic diagram of the module composition of a system for implementing an OPC UA dynamic deployment method for field devices provided by an embodiment of the present invention.

[0028] Figure 3 A flowchart of an OPC UA dynamic deployment method for field devices provided in a preferred embodiment of the present invention.

[0029] Figure 4 An embodiment of the present invention provides a data frame format of a custom protocol for OPC UA deployment communication in an OPC UA dynamic deployment method for field devices. DETAILED DESCRIPTION

[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0031] See also Figure 1 , which shows an OPC UA dynamic deployment method for field devices according to the present invention, comprising at least the following steps:

[0032] Step S1: The field device sets up a communication module and establishes a connection with the programmable logic controller (PLC) to perform data transmission according to a specific communication protocol;

[0033] Step S2: The host computer defines the variables and program logic of the field device according to the application requirements and encapsulates them into an XML format file;

[0034] Step S3: The programmable logic controller (PLC) obtains the XML file obtained in step S2 and parses it, encapsulating the relevant information of the variables into an address mapping table;

[0035] Step S4: According to the address mapping table obtained in step S3, create an OPC UA server on the programmable logic controller (PLC) and add corresponding nodes;

[0036] Step S5: Based on the address mapping table obtained in step S3, the programmable logic controller (PLC) communicates with the field device to create an OPC UA server in the field device and add a corresponding node.

[0037] Step S6: Based on the address mapping table obtained in step S3, an OPC UA client is created on the programmable logic controller (PLC) to establish communication with the field device and monitor the nodes in the field device server.

[0038] Step S7: If the address mapping table node changes, data synchronization is performed through communication.

[0039] See also Figure 2 , which is a schematic diagram of the module composition of a system for implementing an OPC UA dynamic deployment method from a programmable controller to a field device provided by an embodiment of the present invention, as shown in FIG. Figure 2As shown, the method of the present invention is implemented using a modular design and deployed on the programmable controller PLC and the field equipment respectively. The modules on the programmable controller PLC include an XML parsing module, a communication module, an OPC UA client module, and an OPC UA server module. The XML parsing module parses the variables mapped to the field equipment defined in the XML format file of the programmable controller program; the communication module encapsulates the variables into an address mapping table and generates a data frame of a custom protocol according to the address mapping table and sends it to the field equipment; the OPC UA server module is used to save the variable values ​​mapped to the field equipment and generate corresponding nodes; the OPC UA client module is used to communicate with the OPC UA server on the field equipment, synchronize the node value changes of the OPC UA server on the programmable controller to the OPC UA server on the field equipment, and synchronize the node value changes on the OPC UA server on the monitoring field equipment to the OPC UA server on the programmable controller. The modules on the field equipment include an OPC UA server module and a communication module. The OPC UA server module is used to store the node information required to be controlled on the field equipment, and the communication module is used to parse the data frames sent by the programmable controller and update the nodes of the OPC UA server according to the data frames.

[0040] See also Figure 3 , shown is a flow chart of a preferred embodiment of the present invention, wherein in step S1, a connection is established by setting a communication module between the programmable controller PLC and the field device, so that data can be transmitted according to a specific communication protocol. When the OPC UA server node information of the field device is updated, the node can be updated through the protocol, thereby eliminating the need to reprogram the field device.

[0041] In step S2, the variables and program logic of the field device are defined in the host computer according to the application requirements, which specifically includes:

[0042] The user in the host computer defines the variables required in the field device in the variable editing area under the programmable controller device;

[0043] Encapsulate the compiled program into an XML format file;

[0044] Send XML format files to the programmable logic controller PLC;

[0045] In step S3, the variables defined in the XML format file of the programmable controller program are read and parsed, and the relevant information of the variables is encapsulated into an address mapping table;

[0046] In step S4, according to the address mapping table, an OPC UA server is created on the programmable controller PLC and corresponding nodes are added;

[0047] In step S5, according to the address mapping table, communicate with the field device, create an OPC UA server in the field device and add the corresponding node;

[0048] In step S6, according to the address mapping table, an OPC UA client is created on the programmable controller PLC to establish communication with the field device and monitor the nodes in the field device server;

[0049] In step S7, if the node changes, data synchronization is performed through communication.

[0050] The data synchronization method is:

[0051] If the number of nodes in the address mapping table increases or decreases, the OPC UA server on the programmable controller (PLC) also increases or decreases the corresponding nodes and communicates with the field devices, synchronizing the node changes on the OPC UA server of the field devices.

[0052] If the node value in the OPC UA server on the programmable controller (PLC) changes, the OPC UA client on the programmable controller (PLC) initiates communication with the OPC UA server on the field device to synchronize the node value change.

[0053] If the node value in the OPC UA server of the field device changes, the OPC UA client on the programmable controller (PLC) monitors the changed node in the OPC UA server of the field device and synchronizes the node value change on the OPC UA server of the programmable controller (PLC).

[0054] Furthermore, the method for the programmable controller PLC to communicate with the field device is:

[0055] Generate and send data frames in frame format according to the protocol;

[0056] After receiving the data frame, the field device parses the data frame and obtains the node information to be operated, including the node variable name, node ID, node data type and node namespace, as well as the actual address of the variable bound to the node;

[0057] Send node information to the OPC UA server of the field device;

[0058] Furthermore, the protocol is a custom protocol for OPCUA deployment communication, which has good scalability and can achieve simultaneous updates of multiple nodes.

[0059] Furthermore, in step S2, address mapping is completed by variable definition and program writing according to the variables to be controlled by the field device and the variables of the programmable controller;

[0060] Furthermore, in step S3, the address mapping table includes the actual address of the variable in the field device, the actual address of the variable in the programmable logic controller (PLC), the OPCUA node variable name, the node ID, the node data type, and the node namespace;

[0061] Specifically, such as Figure 4 As shown in the figure, the data frame format of the custom protocol used in OPCUA deployment communication is 5n bytes (n is a positive integer), consisting of: a 2-byte start character, a 1-byte data frame number, a 4-byte actual node address, a 1-byte node type, a 10-byte node ID, and a 2-byte CRC checksum. The node type value is the node byte size. To modify or add multiple nodes simultaneously, the byte streams of the actual node address, node type, and node ID are sequentially prepared, and the CRC checksum is added at the end.

[0062] It should be understood that the exemplary embodiments described herein are illustrative and not restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and details may be made without departing from the spirit and scope of the present invention as defined by the appended claims.

Claims

1. An OPC UA dynamic deployment method for field devices, characterized in that: At least the following steps are included: Step S1: The field device sets up a communication module and establishes a connection with the programmable logic controller (PLC) to perform data transmission according to a specific communication protocol; Step S2: The host computer defines the variables and program logic of the field device according to the application requirements and encapsulates them into an XML format file; Step S3: The programmable logic controller (PLC) obtains the XML file obtained in step S2 and parses it, encapsulating the relevant information of the variables into an address mapping table; Step S4: According to the address mapping table obtained in step S3, create an OPC UA server on the programmable logic controller (PLC) and add corresponding nodes; Step S5: Based on the address mapping table obtained in step S3, the programmable logic controller (PLC) communicates with the field device to create an OPC UA server in the field device and add a corresponding node. Step S6: Based on the address mapping table obtained in step S3, an OPC UA client is created on the programmable logic controller (PLC) to establish communication with the field device and monitor the nodes in the field device server. Step S7: If the address mapping table node changes, data synchronization is performed through communication.

2. The OPC UA dynamic deployment method for field devices according to claim 1, characterized in that: In step S7, if the number of nodes in the address mapping table increases or decreases, the OPC UA server on the programmable controller (PLC) also increases or decreases the corresponding nodes, and communicates with the field device through the communication module to synchronize the node changes on the OPC UA server of the field device; If the node value in the OPC UA server on the programmable controller (PLC) changes, the OPC UA client on the programmable controller (PLC) initiates communication with the OPC UA server on the field device to synchronously update the node value change. If the node value in the OPC UA server of the field device changes, the OPC UA client on the programmable controller (PLC) monitors the changed node in the OPC UA server of the field device and synchronously updates the node value change on the OPC UA server of the programmable controller (PLC).

3. The OPC UA dynamic deployment method for field devices according to claim 2, characterized in that: In step S2, address mapping is completed through variable definition and program writing according to the variables required to be controlled by the field device and the variables of the programmable controller.

4. The OPC UA dynamic deployment method for field devices according to claim 2, characterized in that: In step S3, the address mapping table contains at least the actual address of the variable in the field device, the actual address of the variable in the programmable logic controller (PLC), the OPCUA node variable name, the node ID, the node data type and the node namespace.

5. The OPC UA dynamic deployment method for field devices according to claim 2, characterized in that: Communication between a programmable logic controller (PLC) and field devices includes at least: Generate and send data frames in the frame format according to the agreed protocol; After receiving the data frame, the field device parses the data frame and obtains the node information to be operated, including the node variable name, node ID, node data type and node namespace, as well as the actual address of the variable bound to the node; Send node information to the OPC UA server of the field device.