Font Size: a A A

The Research And Implementation Of Data Communications Software Based On OPC Specification

Posted on:2009-06-20Degree:MasterType:Thesis
Country:ChinaCandidate:H B LiuFull Text:PDF
GTID:2178360242481612Subject:Software engineering
Abstract/Summary:PDF Full Text Request
In the field of industrial control, because of diversity of field device type, developers of industrial control software must develop device drivers for each type of device to communicate with hardwares.This brings the heavy burden to users and developers.With the emergence of OPC Technology,the problem was solved fundamentally.Through the development of industry standards,OPC provides a open, unified approach to access field device data for industrial control software.Software developers no longer need to develop a separate driver for each equipment, it only need to interact with the OPC interface provided by the hardware manufacturers in a consistent method.Now,OPC was widely used for its openness , unity and interoperability,it has became the actual standard in the industrial control area.The problem stems from an actual project.This project's goal is to achieve automatic control of factory operations by the control of expert system, through the use of advanced artificial neural network technology, fuzzy control technology. So, expert system must get real-time work state of field device and issue control orders to implement expert strategy through analysis and judgement. Therefore, a important issue of system is how to communicate with field control devices.OPCDaemon is designed and developed in this backgroud, it is software based on OPC technology to realize data communications between expert system and field control device. Its main functions include real-time data upload (read) and real-time data download (write). The data upload function collects the operational status of equipment for the use of expert system analysis. The data download function carries out the expert control strategy by sending command to the field device, and then executed by PLC controller. Moreover, OPCDaemon is also capable of the dynamic configuration. It can change the data sources of reading and writing, as well as strategies according to the business scene, to meet the changing needs of business users. Through analysis of the structure of the original communication, OPCDaemon adopted a new communication mechanism. In the original means of communication , the bottom control equipment provide OPC interface in the form of OPC Server, and reported operating parameters to the configuration software; after analysis of field data, the factory managers, user of configuration software, makes corresponding action to control equipment through configuration software that converts the action into command. New means of communication places a SQL database between expert system and OPC Server, as a data relay-station. After geting data from the scene, OPCDaemon stores the data into the database, these data are readed by the expert system; expert system also stores control data into the database, then OPCDaemon reads these command, and then write them to the device.The new means of communication has the following advantages: (1) the structure of system is clear, its parts is independent relatively, so this means can reduce the coupling between the various parts, namely loosely coupled nature. (2) The developers can develop expert systems and communication module at the same time, no matter the software at the two ends is developed in what program language, what ways, and even what platform .So this not only speeds up the development, but also expands the scope of the application software; (3) When uplink and downlink data passed the database,they are stored in the database directly at the same time , this can reduce the step of storage database,so this means reduced the system's traffic and load.OPCDaemon is consisted of three modules. They are: OPC Services Manager modules - OPCDaemon.exe; Read OPC module - OPCReader.exe; Write OPC module - OPCWriter.exe. These three modules are in the form of executable EXE file. OPC Services Manager is responsible for the other two modules' start, stops and observes their running, at the same time providing dynamic configuration capabilities to users. OPCReader is responsible for the implementation of OPC data upload function; OPCWriter is responsible for the implementation of OPC data download the function. OPCDaemon is divided into three modules, because reading and writing operations must be two concurrent processes. In order to ensure the full-duplex communication between the expert system and the bottom devices, OPCDaemon uses two separate processes to realize this demand.In order to control the other two modules, OPCDaemon uses shared file to communicate between multi-processes. In OPCDaemon, the file OPCDaemon.ini storages some important configuration informations, which is needed in the running of software. The Configuration information is maintained automatically by the software, users do not need intervention. In the configuration file, there is a special process communication area, communication between the processes is realized by reading and writer this area. When the OPC Service Manager want to control the other modules, it will write to this region a command, and the other two modules's running states will also reported to the service manager using the same way.The buffer zone is an internal data structure in the modules of OPCReader and OPCWriter. The role of the buffer zone is to separate the processes of accessing SQL database and accessing OPC server. The buffer zone is a series of arrays, each array elements are corresponded with values that will be writed to or read from an OPC item. For example, when OPCReader visits OPC server, at the first, data will be read into the buffer zone and then write these data in the buffer zone to the database. In this way, the software is with the following advantages: (1) when the software startup, the buffer zone was initialized to default values, this can ensure that in any case, writing database methods are effective. (2) when the OPC data quality is bad, the buffer zone will be assign default values according the table sysopcdfval,so the default values is used. (3) Read and write methods are be separated, so applications can better control the accuracy of reading time. (4) This structure makes software easy to design, the stability is ensured.The group information is other types of data structure, which is used in OPCReader and OPCWriter modules. When modules are running, these data structure provide supports for some operations such as: establishment of OPCItem, initialization of buffer, reading and writing of database, reading and writing of OPC items. There are two types of data structure, one is OPC group information and the other is SQL group information. OPC group informations storage the names of OPCGroup and the numbers of OPCGroup members, SQL group information storage the relationships between database position and OPC items. It is precisely because of the existence of the group information; the software can establish the relationships between the OPC item values in the buffer and the database. So the operations of reading and writing will not operate in chaos. These two strcture are very important in the entire software.OPCDaemon tool is developed according the OPC specification strictly. Just because of this, it can be applied to industrial control environment where the OPC interface is provided. At the same time, its configuration functions such as ReadOPC configuration, WriteOPC configuration, connection management, group management, and default values management, allow the software more flexibility. Therefore, OPCDaemon tool will play a great role in the future industrial application.
Keywords/Search Tags:Implementation
PDF Full Text Request
Related items