Abstract: This paper introduces the implementation of Ethernet communication between a host computer and an OMRON PLC based on OPC technology. It provides the actual steps of using the OPCServer provided by the eView touch screen and the OPC client application implemented in VB. This solution has been successfully applied in an automatic control system. The design method of the communication program introduced in this paper has certain reference value.
Keywords: Host computer; PLC; OPC; Visual Basic
Modern industrial control systems typically use PCs as host computers to achieve automatic control of production processes through data exchange and processing with field industrial control equipment such as PLCs. Currently, the underlying devices of control networks are mostly connected by fieldbuses. However, single fieldbus technology has limitations, and multiple industrial bus technologies will inevitably coexist [1]. With the development and popularization of OPC technology, it has become the communication standard for industrial process control. With such a standard, it is possible for the system and equipment to communicate seamlessly, openly, and conveniently at the enterprise level. More and more hardware manufacturers and software developers are providing OPC support for their products. Therefore, it is of great practical significance to discuss the implementation technology of OPC servers and clients.
Currently, most domestic configuration software has its own OPCClient/Server. For customers who don't need other functions of configuration software but only require OPC for communication, using a self-developed OPCClient to communicate with the OPCServer provided by the hardware manufacturer will significantly reduce the development cycle, effectively utilize resources, and save costs. This article, using a spinning machine control system as an example, introduces a method for implementing real-time communication and data processing between a host computer and an OMRON CP1HPLC in a VB environment using the standard OPC driver, thereby achieving a human-machine interface and reliable system control.
1. Characteristics of OPC technology
OPC (OLE for Process Control) is an industrial technology specification and standard based on Microsoft COM technology. It uses the OLE/COM/DCOM mechanism as the application-level communication standard, adopts the client-server model, places the task of developing access interfaces on hardware manufacturers or third-party manufacturers, and provides it to users in the form of OPC servers. Users can directly realize communication between applications and hardware by accessing data in the OPC server. Using OPC technology, field devices and their drivers can be encapsulated to form an OPC server. The OPC server collects data from the devices and communicates with the OPC client application to complete data exchange. Therefore, its emergence has built a bridge between Windows-based applications and field process control. This open and efficient communication mechanism provides a standard way to extract data from the data source and transmit it to the application. It can effectively integrate various controllers and control systems, enabling devices from different manufacturers to exchange and transmit data using a unified interface. It is very suitable for solving the data exchange and transmission problem in large and medium-sized systems composed of different types of automated equipment [2].
1.1 OPC Interface
OPC typically supports two types of access interfaces: Custom Interface and Automation Interface. Custom Interface is highly efficient, allowing clients to leverage the OPC server's best performance; it is designed for C++ programs. Automation Interface enables interpreted languages and macro languages to access the OPC server, and is therefore generally used by clients employing languages such as VB.
1.2 OPC Objects
There are three types of OPC logical objects: server, group, and item, as shown in Figure 1. The server object contains all the information of the server and is also a container for the group object. One server corresponds to one OPCServer, which is a driver for a device. In addition to containing its own information, the group object is also responsible for managing the data items. Each data item represents a connection to the data source, but it does not provide an external interface. The client program cannot directly operate on the data item. The application must rely on the container group object of the data item to operate on it [3].