Share this

OPC technology and its application in industrial Ethernet

2026-04-06 09:47:19 · · #1
Introduction Ethernet, as a relatively mature technology, is gradually penetrating the field of automation, extending from the enterprise decision-making level and production management scheduling level to the field control level. Due to its contention-based transmission method, Ethernet has the characteristic of transmission uncertainty. However, with increased bandwidth, strengthened redundancy measures, and improved self-diagnostic programs, Ethernet can fully meet the real-time requirements of small and medium-sized control systems. At the same time, Ethernet has advantages such as low cost of related network products, good openness, and mature technology. Currently, Profibus, Devicenet, Controlnet, and Lowworks all use Ethernet to transmit their messages, establishing standards for communication between field devices and Ethernet, bringing Ethernet into the field level of industrial automation. When field intelligent devices transmit field information to the monitoring computer via industrial Ethernet, the problem of information sharing and interaction arises. On the one hand, the internal applications of the monitoring computer need to process the field information; on the other hand, the enterprise production management level needs to communicate and transmit information with the monitoring computer. The emergence of OPC has solved the bottleneck problem of breaking through the "information silos" in control systems. 1. OPC (OLE for Process Control) Technical Specification and Significance: OPC technology is a technical specification and standard built upon Microsoft's OLE/COM technology. It adopts a client/server model and defines a set of COM objects and their dual interfaces. OPC objects mainly include servers, groups, and items. In addition to maintaining its own information, the OPC server object also acts as a container for group objects, dynamically creating or releasing them. A group object, in contrast to an item, is also a container, providing a mechanism for managing items. An OPC item represents a connection to data in the OPC server and includes three basic attributes: value, quality, and time stamp. The OPC object dual interface consists of the OPC Automation Interface and the Custom Interface. In client/server (C/S) mode, the client program connects to the OPC server through the interface and calls the methods of the OPC object. Generally, the Automation Interface provides great convenience for high-level language client programs, but the data transmission efficiency is relatively low, while the Custom Interface provides a flexible and efficient calling method for client programs written in C/C++. OPC technology has established a set of interface specifications that meet the requirements of industrial control, seamlessly connecting field signals with software such as SCADA and HMI according to a unified standard, while effectively separating hardware and application software. As long as the hardware developer provides a server with an OPC interface, any client program that supports the OPC interface can access these devices in a unified way without the need to repeatedly develop drivers. This greatly improves the interoperability and adaptability of the control system. Figure 1 illustrates the overall hierarchical structure of the Ethernet control system. In the field control layer, the PC104 embedded system serves as the field intelligent node. Its external analog input/output and switch signal input/output I/O cards primarily perform various control functions, acquire data, monitor status, issue alarms, and upload the acquired data. The monitoring computer is a PC equipped with two network cards. One network card communicates with the lower-level PC104, while the other network card forms a local area network with other computers in the production management and scheduling layer. The monitoring computer runs an OPC data access server program, which sends data from the field intelligent nodes to the monitoring software via the OPC interface. It also performs complex configuration tasks using configuration software, downloads the configuration information to the PC104, and adjusts its control algorithms and parameters. Meanwhile, the OPC client programs of other management and scheduling computers access the OPC server program via DCOM for information exchange. Therefore, the OPC server in the Ethernet control system organically connects the enterprise field control layer and the production management and scheduling layer, forming a highly open and reliable distributed control system, playing a crucial bridging role. 3. Design and Implementation of the OPC Data Access Server The OPC data access server can be designed according to the system structure shown in Figure 2. It mainly consists of server objects, group objects, item objects, data storage area, and TCP/IP communication interface. Since the OPC data access server needs to communicate with field devices through the network card and interact with client programs through the OPC interface, a multi-threaded model is adopted to ensure data access efficiency. To avoid different threads operating on data in the data area simultaneously, mutual exclusion control of critical sections also needs to be considered. OPC technology is based on Microsoft's COM technology and needs to directly interact with the underlying hardware, so VC is a more flexible and convenient implementation. The OPC data access server is mainly divided into the implementation of the OPC general interface, hardware interface, and data storage area. In this system, the implementation of the hardware interface mainly involves implementing the Ethernet communication interface. 3.1 Implementation of the OPC General Interface First, the name (ProgID) and class identifier (CLSID) of the OPC data access server are defined, and the OPC data access server class object is implemented. Then, from the OPC Server, OPC Group, and OPCItem classes defined in the OPC specification, three new classes are derived: Device, Board, and Channel, respectively. The interfaces defined in the OPC specification can be divided into optional and required interfaces, but for any OPC server, the member functions of the required interfaces should be implemented. Therefore, the member functions of the required interfaces in the derived classes are overridden, and the member functions of the optional interfaces are overridden according to the actual situation, such as the IOPCBrowseServerAddressSpace interface. To meet practical requirements, it is also necessary to define and implement the special attributes and methods of each derived class. For example, an IP address attribute is added to the Device class to identify the field PC104 intelligent nodes. Additionally, a search function is added to automatically list the IP addresses of the PC104 intelligent nodes connected to the field control layer. 3.2 Implementation of Ethernet Communication Interface The design of the communication interface is the key to the application of OPC data access server in industrial Ethernet control system. Since the control system is different from ordinary local area network, the reliability and real-time performance of communication are important factors that must be considered. (1) Reliability consideration Since Ethernet supports the TCP/IP protocol, communication programs can be developed using sockets, which will greatly reduce the development difficulty. When programming with sockets, the main types used are stream sockets (SOCK_STREAM) and datagram sockets (SOCK_DGRAM), and there are also two corresponding communication methods: one is connection-oriented, using the TCP protocol; the other is connectionless, using the UDP protocol. When using the UDP protocol, it provides unreliable connectionless datagram transmission service and does not provide message arrival confirmation, sorting, and flow control functions, so messages may be lost, duplicated, or out of order. TCP is based on the abstract concept of connection. It identifies a virtual circuit connection, which requires both endpoints to agree to the connection in order to communicate. It treats the data stream as a sequence of bytes, and divides this sequence into several segments for easier transmission. During transmission, it has an acknowledgment and retransmission function. In addition, TCP uses a special sliding window mechanism to solve problems such as transmission efficiency and flow control. To ensure reliability, the TCP communication protocol is adopted in this system. (2) Real-time considerations Ethernet uses a random access protocol - Carrier Sense Multiple Access with Collision Detection (CSMA/CD) Media Access Control Protocol. Although this data transmission protocol is relatively simple, the randomness of data transmission time caused by collisions has become the root cause of the obstacles to Ethernet entering the industrial control field. In the Ethernet currently used in the industrial control field, the real-time requirements of control can be met by limiting the number of nodes connected to the Ethernet, controlling network traffic, and keeping the bus under light load conditions. The TCP/IP communication mode adopts a client/server model. The server program passively waits for communication, while the client program actively initiates communication. In this system, the lower-level PC104 uses a DOS system and operates in a single-threaded mode. It is responsible for both communication and executing specific control functions, thus acting as the communication client. The monitoring computer, using a multi-threaded Windows NT/2000 system, acts as the communication server. Therefore, a dedicated thread is created in the OPC data access server to listen for connection requests from client programs. If a request is received, another thread is created to handle the communication, storing the received data in a dedicated data storage area allocated for the OPC server. This communication thread is closed after the communication ends, while the listening thread continues to run. This ensures real-time data transmission. 3.3 Implementation of the Data Storage Area The data storage area is a crucial component of the OPC server program, containing data items defined by the server program. The OPC client program accesses the storage area data through the OPC general interface, and the hardware driver continuously writes the latest field data into the data area. If the server program implements the optional IOPCBrowseServerAddressSpace interface, the client program can browse the names of data items in the data storage area through this interface. In the actual design process, the data storage area is organized by mimicking the data organization methods in the OPC specification, and three corresponding data item classes—CGLOBALServer, CGLOBALGroup, and CGLOBALItem—are designed to manage the data storage area. The `CGlobalServer` class contains instances of the `CGlobalGroup` class and defines member functions to manipulate the specific data of the `CGlobalGroup` class objects. The `CGlobalGroup` class, in turn, contains instances of the `CGlobalItem` class and defines member functions to manipulate the specific data of the `CGlobalItem` class objects. The `CGlobalItem` data item class includes three basic attributes: Value, Quality, and Time Stamp, as well as attributes such as data item name and unit of measurement. Since data items are always related to specific hardware, it is necessary to add device-related attributes and related functions to set and retrieve these attributes. 4. Application of OPC Data Exchange Servers in Ethernet Control Systems To better solve the information exchange problem, the OPC Foundation released the OPC Data Exchange (DX) 1.0 specification in March 2003. It is essentially an OPC Ethernet data exchange standard, an extension of the Data Access Specification (DA). The biggest difference is that the DA addresses the vertical transmission of field information within the control network, while the DX addresses the horizontal transmission of field information. This specification proposes a standard configuration interface architecture, enabling communication between any OPC data access servers on the control network as long as they support this interface. It also supports remote configuration, diagnostics, monitoring, and management, aiming for Plug & Play. Figure 3 shows the structure of information exchange between data access servers using OPC data exchange technology. In this case, dual-port/multi-port clients are no longer needed to support communication between OPC data access servers. 5. Conclusion The OPC data access server designed in this paper has been running well in the Ethernet control system. The entire control system has also passed testing and evaluation, proving that it can meet the transmission latency requirements of general industrial control fields. Its operability, openness, and reliability are also high, making it fully suitable for small and medium-sized control applications. With the development of Ethernet technology, it is believed that it will gradually be able to handle the control tasks currently undertaken by industrial automation networks. Introducing OPC technology into industrial Ethernet control systems can effectively promote the development of Ethernet control systems and the integration of enterprise field control layers, production process management layers, and scheduling decision-making layers.
Read next

CATDOLL Tami Hybrid Silicone Head

The hybrid silicone head is crafted using a soft silicone base combined with a reinforced scalp section, allowing durab...

Articles 2026-02-22
CATDOLL 139CM Sasha Silicone Doll

CATDOLL 139CM Sasha Silicone Doll

Articles
2026-02-22
CATDOLL 123CM Nanako TPE

CATDOLL 123CM Nanako TPE

Articles
2026-02-22
CATDOLL 60CM Tami Silicone

CATDOLL 60CM Tami Silicone

Articles
2026-02-22