MES system and automation equipment data interaction method based on OPC UA protocol
Through the OPC UA protocol and KepServerEX tool, the data interaction between the MES system and a variety of automation devices is realized, the problems of communication protocol compatibility and data acquisition flexibility are solved, the stability and flexibility of data acquisition are improved, and the message blockage is avoided .
Patent Information
- Application Number
- CN202411179281.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-01-14
AI Technical Summary
When existing MES systems interact with automation equipment of different brands and models, there are many communication protocols, resulting in inflexible data collection and blocked messages. The number of PLC equipment data items is huge, the acquisition table is inconvenient to access, and the code is repeated and frequently adjusted. .
Using the data interaction method between the MES system and automation equipment based on the OPC UA protocol, OPC UA services are built through the KepServerEX tool, and OPC UA Client interacts with PLC equipment to realize data collection and storage. XML file generation and .NET platform are used to develop data collection services. , provides a unified OPC UA communication interface.
It realizes unified collection and interaction of multi-device data information, solves the problem of communication protocol compatibility, improves the flexibility and stability of data acquisition, reduces repeated code adjustments, and avoids message blockage.
Smart Images

Figure CN119316488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial intelligent manufacturing, and in particular to a method for data interaction between an MES system and automation equipment based on the OPC UA protocol implemented by a KepserverEX tool. Background Art
[0002] In modern industrial production, data collection is the basis for intelligent control. When the company's production line undergoes digital transformation, the MES system and automation equipment interact using the OPC DA (data exchange protocol in the field of industrial automation) protocol to achieve equipment operation data collection and equipment interaction.
[0003] 1. The OPC .DA (data access) client must be able to connect to the DA server and establish OPC groups (Group: group) and OPC data items (Item: data item). This is the basis of OPC .DA. Without this basis, other functions of DA are impossible to achieve. In order to access process data, the DA client needs to specify the name of the DA server, the name of the machine running the DA server, and the Item definition on the DA server in advance.
[0004] 2. The client accesses the process data by accessing the Group and Item it has established. The client can select a device or buffer as the data source for its access. The client's process data access includes reading, updating, subscribing, and writing process data.
[0005] 3. The server responds to the client's process data access request and processes it, notifying the client when it is completed. For example, in asynchronous reading and writing, the server must notify the client when the operation is completed.
[0006] 4. The data acquisition program DA client accesses the DA server, all of which use OPC data item points to access the collected data. A device has hundreds to thousands of data items. It is very inflexible to use the program to access all the data items in a table. Creating a new device requires copying and adjusting the code again, which requires a lot of repeated code writing. Summary of the invention
[0007] The present invention provides a method for data interaction between an MES system and automation equipment based on the OPC UA protocol. The present invention solves the problem that the underlying equipment of different brands and models of field equipment in the MES system leads to a variety of communication protocols in the workshop, and realizes the collection of data information from multiple devices and interaction with the devices.
[0008] The technical solutions to the above problems are as follows: The data interaction method between MES system and automation equipment based on OPC UA protocol, MES system includes MES platform, upper layer, middle layer and lower layer, among which, the upper layer is data collection service, MES client and Oracle database, the middle layer uses OPC UA Client to build the architecture, and the bottom layer uses KepServerEX to establish OPC UA service; the upper layer data collection service, MES client and Oracle database are used to realize data collection, display and storage, and form data interaction with the middle layer OPC UA Client; the middle layer OPC UA Client realizes data interaction with several PLC devices through the bottom layer KepServerEX; The above system exchanges data with the automation equipment through the following steps: S1, MES platform maintenance object model: configure basic information of automation equipment; S2, MES platform maintains data collection configuration: maintains collection server IP, business type, collection type, collection item name, collection conditions, collection content, and data collection interaction logic; S3, Published Model: Publishes the communication parameters of the automation equipment automatically generated on the KepserverEX tool of the acquisition server; S4, install the collection service: load the data collection configuration maintained by the MES platform, register to the OPC event uniformly, and subscribe to all OPC Item values; S5, open KepserverEX Quick Client: visualize automation equipment data, interact with automation equipment to monitor and modify data.
[0009] Furthermore, an OPC UA Client Driver module is embedded in the OPC UA Client, and the module is used to connect two OPC servers on the same network through the Internet and create a tunnel between the two OPC servers.
[0010] Furthermore, the data collection service generates an XML file by reading data in the Oracle database collection configuration table, and interacts with the PLC according to the logic defined by the MES.
[0011] Furthermore, the KepServerEX and the application realize data interaction through the OPC protocol.
[0012] The beneficial effects of the present invention are as follows: the present application uses the MES platform to quickly establish a configuration table, quickly collects equipment data through the configuration table, and collects all equipment data into the system database, which solves the problem that the underlying equipment of different brands and models of field equipment in the MES system leads to a variety of communication protocols in the workshop. In order to realize the collection of equipment data information and interaction with equipment, the workshop communication system needs to be compatible with many devices and integrate a large amount of communication protocol data. The problem of message jams that are prone to occur during real-time communication. It also solves the problem that the amount of data collected by PLC equipment is huge, the collection table is inflexible to access all data items with a program, the equipment properties need to be configured in KepserverEX, the code needs to be adjusted repeatedly, and the interaction is unstable.
[0013] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 The figure is a schematic diagram of the data interaction method between the MES system and automation equipment based on the OPC UA protocol of the present invention. DETAILED DESCRIPTION
[0015] like Figure 1 As shown, the data interaction method between the MES (manufacturing execution system) system and automation equipment based on the OPC UA (open production control and unified architecture) protocol of the present invention, the MES system includes an MES platform, an upper layer, a middle layer, and a lower layer, wherein the upper layer is a data acquisition service, an MES client, and an Oracle database, the middle layer uses the OPC UA Client (a client for communicating with OPC) to build an architecture, and the bottom layer uses KepServerEX (a highly configurable and easy-to-use enterprise-level connection platform) to establish an OPC UA service; the upper layer data acquisition service, the MES client, and the Oracle database are used to realize data acquisition, display, and storage, and form data interaction with the middle layer OPC UA Client; the middle layer OPC UA Client realizes data interaction with several PLC (programmable logic controller) devices through the bottom layer KepServerEX.
[0016] The data collection service generates XML (Extensible Markup Language) files by reading data from the Oracle database collection configuration table, and interacts with the PLC according to the logic defined by the MES. The OPC UA Client is embedded with an OPC UA Client Driver (client driver for communicating with OPC) module, which connects two OPC (data exchange protocol in the field of industrial automation) servers on the same network through the Internet and creates a tunnel between the two OPC servers. The KepServerEX and the application realize data interaction through the OPC protocol.
[0017] The above system exchanges data with the automation equipment through the following steps: S1, MES platform maintenance object model: configure the basic information of automation equipment, including equipment identification, IP (Internet Protocol) address, PLC model, DB (data block) address, data type, and scanning rate. The collection configuration table is synchronized to the production line database through the ETL (data extraction (Extract), transformation (Transform), loading (Load)) tool. The collection service connects to the Oracle database and stores the collected data in the database table. The ETL synchronization tool synchronizes the data to the MES platform database.
[0018] S2, MES platform maintains data collection configuration: maintains collection server IP, business type, collection type, collection item name, collection conditions, collection content, and data collection interaction logic; S3, publish object model: Click publish to automatically generate the communication parameters of the automation equipment on the KepserverEX tool of the acquisition server; including the device address, protocol, device IP address, port number, etc.
[0019] S4, install the collection service: load the data collection configuration maintained by the MES platform, register to the OPC event uniformly, and subscribe to all OPC Item values; develop the data collection service using the C# programming language on the .NET platform, install the collection service on the server, start the service to load the collection configuration, subscribe to the configured OPC collection items, and collect the production data of the automation equipment and the business logic interaction according to the collection configuration.
[0020] S5, open KepserverEX Quick Client (quickly open the client for communicating with OPC): visualize automation equipment data, interact with automation equipment to monitor and modify data.
[0021] Based on the above solution, various types of automation equipment need to be installed in the workshop, and the communication protocol of the automation equipment needs to support OPC UA. The automation equipment control is performed by the PLC that supports OPC UA. The MES system defines the data that needs to be collected, and the data acquisition module of the MES system collects data and communicates and interacts with the PLC at the end of each automation equipment. The data generated or obtained by the production process automation equipment is collected by the PLC; after the PLC collects the data, it writes the processed data to the DB address block, and the MES system reads the corresponding address through OPC UA; the MES system determines whether the feedback device needs to perform other actions. If necessary, the corresponding value is written to the PLC through OPC UA to the corresponding DB address, and the PLC allows the device to perform the action; the MES system stores the collected data, analyzes it according to the corresponding rules and calculations, and displays the results of the analysis.
[0022] In summary, the method of the present invention takes OPC UA as the core technology, and utilizes its advantages such as strong data transmission security, integrated address space and cross-platform, designs and implements the intelligent workshop data collection and equipment interaction system, and constructs a C / S communication architecture based on the OPC UA standard specification. First, KEPServer EX is used to build an OPC UA server, and the production data of the equipment is collected by configuring the corresponding drive channel type, IP address, port number, node tag attribute and other information for the bottom-level equipment in the workshop, and the data interaction between the equipment is completed. The server terminal information is configured to reserve a unified OPC UA communication interface for the client. Secondly, the C# programming language is used on the .NET platform to develop the MES client and data acquisition service, and the functions of accessing the server to visually read, modify, monitor and store the collected data and interact with the programmable controller (PLC) are realized. The present invention has a unified architecture, strong scalability, and is suitable for the field of industrial intelligent manufacturing. The present invention solves the problem that the underlying devices of different brands and models of field equipment in the MES system lead to a variety of communication protocols in the workshop. In order to realize the collection of equipment data information and interaction with equipment, the workshop communication system needs to be compatible with many devices and integrate a large amount of communication protocol data. The message congestion that is prone to occur during real-time communication.
[0023] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the structure of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the protection scope of the present invention.
Claims
1. A method for data interaction between an MES system and automation equipment based on the OPC UA protocol, characterized in that: The MES system includes the MES platform, upper layer, middle layer and lower layer. The upper layer is the data collection service, MES client and Oracle database. The middle layer uses OPC UA Client to build the architecture, and the bottom layer uses KepServerEX to establish OPC UA service. The upper layer data collection service, MES client and Oracle database are used to realize data collection, display and storage, and form data interaction with the middle layer OPC UAClient. The middle layer OPC UA Client realizes data interaction with several PLC devices through the bottom layer KepServerEX. The above system exchanges data with the automation equipment through the following steps: S1, MES platform maintenance model: configure basic information of automation equipment; S2, MES platform maintains data collection configuration: maintains collection server IP, business type, collection type, collection item name, collection conditions, collection content, and data collection interaction logic; S3, Published Model: Publishes the communication parameters of the automation equipment automatically generated on the KepserverEX tool of the acquisition server; S4, install the collection service: load the data collection configuration maintained by the MES platform, register to the OPC event uniformly, and subscribe to all OPC Item values; S5, open KepserverEX Quick Client: visualize automation equipment data, interact with automation equipment to monitor and modify data.
2. The method for data interaction between an MES system and automation equipment based on the OPC UA protocol according to claim 1, characterized in that: The OPC UA Client is embedded with an OPC UA Client Driver module, which connects two OPC servers on the same network through the Internet and creates a tunnel between the two OPC servers.
3. The method for data interaction between an MES system and automation equipment based on the OPC UA protocol according to claim 1, characterized in that: The data collection service generates an XML file by reading data in the Oracle database collection configuration table, and interacts with the PLC according to the logic defined by the MES.
4. The method for data interaction between an MES system and automation equipment based on the OPC UA protocol according to claim 1, characterized in that: The KepServerEX and the application program implement data exchange via the OPC protocol.