Design of Real Time Data Acquisition System Framework for Production Workshop Based on OPC Technology

In this paper, the low level of production management information in a hydraulic torque converter enterprise is presented. It is needed to develop a digital assembly shop MES to solve this problem. There is a high demand for the real-time data acquisition of the production line in the digital assembly shop MES. According to the actual needs of MES in digital assembly workshop, a real time data acquisition system framework based on OPC technology and database technology is proposed. The framework can be used to meet the actual needs of the real time monitoring system and production business information processing in MES.


Introduction to OPC Technology
The full name of OPC is OLE for Process Control.The emergence of OPC has built a bridge for Windows based applications and field process control applications.In the past, in order to access the data information of various devices on the production line, special interfaces were needed for different types of devices.Due to the wide range of equipment and the continuous upgrading of the product line, users and software developers often have a huge burden.And this does not meet the actual needs of the production line, so system integrator and developers urgently need a universal and efficient device driver.In this case, the OPC standard is generated.
The OPC standard is based on Microsoft Corps OLE technology, and its formulation is accomplished by providing a standard OLE/COM interface.OLE 2 technology is used in OPC technology.OPC technology uses the OLE/COM mechanism as the communication standard for applications.OLE/COM is a client / server model with the advantages of language independence, code reusability, and easy integration.After the adoption of OPC technology, applications use a unified way to access different types of equipment on the production line, thus ensuring the transparency of the software for customers and reducing the burden on enterprises.

System Framework
The framework of real-time data acquisition system in production workshop based on OPC technology is shown MATEC Web of Conferences in figure 1.The real-time data of the sensors in the workshop and the material, personnel and other information on the production line are collected by means of PLC, DCS, HMI and other equipment.Each data is marked as a OPC entry, which is uploaded to the OPC Server through the standard OPC DA protocol.The direct interaction between the data acquisition end and the OPC Server is adopted by some real-time data acquisition systems based on OPC technology, which will result in slower response to data collection due to network and OPC Server reasons.In the system designed in this paper, a OPC data processing program is developed through C# to access the OPC entries in OPC Server.When the value of a OPC item changes, the OPC data processing program finds and updates the latest value of the OPC item to the OPC item information table in the relational database.[12][13] .

System implementation 4.1 The naming and grouping of OPC Items
The torque converter production line is divided into 5 production areas.In order to facilitate the processi ng of information points by the OPC data processing program, all the OPC Item on the production line a re divided into 5 OPC groups.The five OPC groups are Pump_Island, Turbine_Island, Coverwheel_Island, Guide_Island, and Final_Assembly.Each OPC Item corresponds to a station on the production line, so ea ch OPC Item item is named in the form of Figure 2.

Figure 2. OPC Item item naming rules
As shown in Figure 2, the OPC group name is the name of the production area to which the OPC item belongs;the station number is the number of stations in which the OPC Item is located (numbered from 1 in the order of the stations on the production line); the device name is the name of the device under which the OPC Item item belongs to; the status point name is called the specific information name represented by the OPC Item.

Design of OPC data processing program
The OPC data processing program is used to connect to OPC Server.When a OPC Item value changes, the program modifies the current value, historical value, and the latest update time in the OPC Items table of the relational database.The overall flow of the handler is shown in figure 3.
According to the access rules of the OPC DA protocol, the flow of the OPC data processing program is described as follows: The first step is to create the OPC Server object representing the actual OPC server; The second step connects the actual OPC server through the computer name and IP address of the actual OPC server to be connected; The third step if the connection is successful, read all the information from the OPC packet in a relational database, create a OPC group object for each packet, the packet is created before adding all objects to create a OPC Server object; The fourth step to obtain OPC information of a OPC packet from a relational database, create a the OPC Item object for each OPC, and each OPC Item object to the OPC object in group.
The fifth step registers the Data-Change event for each OPC group object.After the Data-Change event is registered, once the value of a OPC Item item changes, the record value in the OPC Item table in the relational database is modified (modifying the current value, the historical value, and the last update time).Some of the key code is shown in figure 4.

Summary
The real time data acquisition system framework of production workshop designed in this paper adopts mature OPC technology.Through this framework, the production workshop MES does not need to write different types of interfaces for different types of equipment on the production line to obtain production data.Enterprise managers can obtain production data in real time through the system developed by this framework, and adjust production in a timely manner.This framework can greatly improve the level of enterprise informatization.

Figure 1 .
Figure 1.Real time data acquisition system framework of production workshop

Figure 3 .
Figure 3. the overall flow of the handler

Figure 4 .
Figure 4. some of the key code