Share this

Implementing real-time communication between PCs and PCCs using LabVIEW based on OPC.

2026-04-06 06:21:37 · · #1

Abstract: Addressing the real-time communication requirements of modern industrial process control and the shortcomings of existing fieldbuses, this paper designs a real-time data communication scheme between a PC and a PCC based on LabVIEW, utilizing the popular open standard interface technology OPC. The specific implementation process is also presented. This scheme has been successfully applied to the "Key Technology Platform for Testing in the Development of Polymers and Their Composites." Practical application has demonstrated that this scheme eliminates complex programming languages, simplifies the development process, and is an effective method for establishing comprehensive industrial automation control systems and realizing the networking of measurement and control systems.

Keywords: OPC, PCC, LabVIEW, real-time communication

Abstract: To realize real-time communication in modern industrial process control and to ameliorate the deficiency of field-bus, the real-time data communication between PC and PCC based on OPC is designed, by using LabVIEW as the upper supervisory software. And also the detailed produces and programs are given out. This design method is successfully applied to the key technologies test platform on facing polymer macromolecule and polymer composite development. The result shows that this method can dispense with complicated programming, simplify the process of development. It is an efficient method to build Facilely comprehensive industry automation control system and implement networked measurement and control system.

Keywords: OPC,PCC,LabVIEW,Real-time Communication

1 Introduction

When a PC communicates with a PCC (Programmable Computer Controller), the PCC acts as the lower-level machine, performing output control, data acquisition, and status judgment. The PC performs data analysis, calculation, storage, display, and printing to monitor the controlled system. This system mode has been widely used in modern industrial control. However, how to effectively and easily achieve real-time communication in monitoring systems has always been a problem that needs to be solved. The emergence of OPC (OLE for Process Control) technology has provided a possibility for solving this problem.

OPC is a standard interface protocol based on the Windows NT technical specifications. When using third-party hardware, as long as the hardware developer provides OPC Server software, developers do not need to write low-level drivers. They can interact with the hardware through the user software's OPC Client, making the integration of hardware and software from different manufacturers easier. Using OPC technology, customers do not need to understand the kernel of the industrial control system; they only need to obtain real-time data through OPC Client/OPC Server access [1,2,3,4].

This article details the implementation process of real-time communication between a LabVIEW-based PC and a B&R PCC2003, successfully achieving real-time communication in the control system.

2 System Structure Composition

A key testing technology platform for polymers and their composites is developed for performance testing of polymer materials. It mainly includes functional modules such as a capillary rheology unit, a single-screw extrusion unit, and an injection molding unit. Its control system adopts a CAN-based fieldbus intelligent control system structure, using a B&R PCC2003 programmable computer controller. A simplified diagram of the control system structure is shown in Figure 1.

The system comprises a main control station responsible for host computer operation, a CAN I/O expansion station for controlling functional modules such as the capillary rheology unit, mixing unit, and injection molding unit, a human-machine interface for on-site operation, and a computer data acquisition and analysis system for data acquisition, dynamic data processing, and outputting test results. Therefore, achieving real-time data exchange between the PC and the main control station (PCC) is crucial to this measurement and control system.


Figure 1. Simplified diagram of the control system structure

In this design, the host computer is an Advantech industrial control computer, and the slave computer is a B&R PCC2003 system. The physical connection between the PCs is an RS232 interface, and the host computer's data acquisition and dynamic signal processing system is based on the LabVIEW 8.0 software platform for secondary development.

3. Communication Scheme Design and Implementation

After LabVIEW sends the data to be published to the OPC server, it transmits it to the underlying device (PCC) via RS232 serial port. The PCC then transmits the data to the OPC server, where LabVIEW reads the data and displays it on the front panel, thus obtaining the field data. OPC can be considered a "software bus." Applications read the OPC data source, and the OPC Server converts the field data into a unified OPC format, making configuration simpler and more universal. The data types provided by OPC mainly include: ① Real-time measurement data: barrel temperature, melt pressure, screw torque, speed, etc. ② Control parameters: on/off, operating status information, hardware connection status, and software system status, etc. Therefore, the key to achieving real-time communication between the PC and PCC based on OPC technology lies in establishing a one-to-one correspondence between each data item on the OPC server and each port address in the PCC, and in how the real-time monitoring programs developed in LabVIEW access the OPC server.

3.1 Implementation of Real-Time Communication between PCC and OPC Server

3.1.1 PCC Communication Parameter Settings

Configure the basic parameters for communication between the PC and the PC (such as communication port address, communication protocol, communication baud rate, etc.) for the OPC server to use, and grant the PC access to the memory area and data area required by the PC.

3.1.2 Establishment of the OPC Server

To use the OPC communication protocol, an OPC server needs to be run, and the OPC Server needs to be configured [5], as shown in Figure 2.


Figure 2 OPC Server Settings

1) Communication path settings

The communication path settings include configurations for PVI (Process Visualization Interface) Connections, Lines, Devices, Stations, CPUs, and Tasks, with their corresponding functions shown in Table 1. PVI Connections can be configured for local communication or remote communication based on TCP/IP.

2) OPC Server object settings

The OPC Server consists of three types of objects: Server objects, Group objects, and Item objects. Together, they implement the OPC server interface definition functionality. The OPC Server object is a container for OPC Group objects. By calling the OPC Server object, a session is established between the application and the underlying device, and a session handle is returned. This handle can be used to create OPC Group objects based on the OPC Server object. An OPC Group object is a collection of related data. By creating OPC Item objects on it, an association with the field test node is established. Accessing the OPC Item object returns the field test data. An OPC Item defines attributes such as Value, Quality, Timestamp, Device No., Board No., and Channel No.

OPC Server objects correspond to variables at specific addresses in the PCC memory and data areas. LabVIEW uses the OPC Client and OPC Server to interact with the PCC via these variables. Server objects, group objects, and data item objects can be managed in a tree-like directory structure, with up to six levels of directories. In the parameter dialog box for each object, set its parameters and select its communication path. The data type and address of the data item object must be consistent with the PCC variables.

3) OPC Server Access Method Configuration

There are two ways to access an OPC server: local communication and network communication. Configure the OPC server access method in "Server Parameter". Typically, for transparent access, the OPC server and client program reside on different machines. The client program accesses the OPC server remotely by providing the remote computer name and OPC server ID. The OPC server and client program can also reside on the same computer; in this case, either local or remote access to the OPC server can be configured.

3.2 Implementation of Real-Time Communication between LabVIEW and OPC Server

The real-time data communication task between the PC and PCC is achieved by LabVIEW reading and writing field test data in the PCC in real time. Since the LabVIEW software platform supports DataSocket technology, LabVIEW can communicate with the B&R PVI OPC Server through an NI OPC Client implicitly contained in DataSocket, thereby realizing real-time data interaction between the PC and PCC.

There are two methods in LabVIEW to access the OPC server using DataSocket technology to achieve real-time communication with the PCC [6,7]:

1) Direct link to front panel controls

DataSocket's front panel object linking is a data transfer method that requires no programming; it simply involves mapping the front panel object to an OPC data item object. Therefore, when the data variable relationships are not very complex, the front panel object linking method is simpler, significantly saving programming time and improving development efficiency. The method for establishing a link between a front panel object and an OPC data item object is as follows: Right-click on the front panel object to be linked, select "Data Binding" under the "Properties" option in the pop-up dialog box, and a dialog box as shown in Figure 3 will appear for setting up the front panel object link.


Figure 3 Front panel control links

In the Data Binding Selecting dropdown menu, select DataSocket; in Mode, select the connection type, and then select DSTP Server next to DataSocket URL. This will connect to the OPC server you just set up. Select the variable name on the server that corresponds to the variable you are setting, as shown in Figure 4. After connecting, a connection indicator light will appear in the upper right corner of the front panel object. When running the program, the indicator light will be green if the connection is correct, and red otherwise.

2) DataSocket Programming

Using control properties to directly link and transmit network data offers the advantages of being programmable and easy to use; however, it suffers from data opacity, limiting transmission and display to controls set up on the client side and hindering effective data processing. If client-side processing of server-input data is required, it must be implemented programmatically using the API functions provided by the DataSocket library.


Figure 4. Links to variable names on the OPC server

The DataSocket function library includes modules such as Open, Close, Read, Write, and Select. Before reading or writing data using the DataSocket Read and DataSocket Write functions, the DataSocket Open function must be used to open a connection corresponding to the item in the OPC server specified by the URL. The URL format is opc://localhost/servername/itemID, where opc refers to the DataSocket transport protocol, the two middle segments are the host IP address or identifier and the server name, respectively, and the last segment is the data item, whose name must match the corresponding item name in the OPC server. Furthermore, to ensure no data loss during reading, an enumerated constant is used in the DataSocket Open function to set the DataSocket connection mode to buffered mode. To improve the efficiency of writing data, data such as single-precision floating-point numbers, unsigned integers, and switch values ​​can be uniformly converted to variant data types using the Variant function, especially when writing attributes such as time and name of transmitted data.

4. Experimental Results and Analysis

The single-screw extrusion module in the "Key Technology Platform for Testing Polymers and Their Composites" is the most complex module in the entire testing platform. It requires high testing accuracy, involves a wide variety of variables, and must be able to display and save real-time data such as pressure, four temperature ranges, motor speed and torque, vibration signal amplitude and frequency, and the weight of the extruded product. It also has strict time control requirements and alarm protection settings for key parameters. After running the LabVIEW program and setting all parameters, click "Start Test" to begin the test, as shown in Figure 5.


Figure 5. Test of single-screw extrusion module based on OPC communication.

The single-screw extrusion module model display area on the upper right side can display the current extruder's four temperature and pressure values, motor speed and torque, vibration signal amplitude and frequency, and the actual weight of the extruded product in real time. The entire system is stable, with fast data transmission rate and high accuracy, meeting the high-efficiency real-time data transmission requirements of industrial sites and greatly reducing the error rate during data transmission, proving the effectiveness of this communication solution.

5. Conclusion

This method is also applicable to communication buses such as PROFIBUS and CAN. The LabVIEW software platform can connect to multiple OPC servers simultaneously, and one OPC server can connect to multiple PCCs. Users can define, add, or delete PCCs themselves, thus easily achieving system integration and higher system interconnectivity, and meeting standard mechanisms for communication with a large number of data sources. The effective implementation of this system's communication scheme has high practical reference value for similar systems.

The innovation of this paper lies in the fact that it is the first time that the latest technology in the field of industrial control—OPC technology—has been applied to the field of polymer processing. By using OPC interface technology as middleware for open industrial control systems and LabVIEW as the host computer user interface development software, batch processing of multivariable real-time data has been realized, ultimately achieving precise control and providing a comprehensive solution for system information integration.

References:

[1] Raul Alves Santos, Julio E. Normey-Rico, Alejandro Merino Gomez, OPC based distributed real time simulation of complex continuous processes[J]. Simulation Modelling Practice and Theory. 2005 (13): 525–549

[2] OPC Foundation. OPC DA 2.05a Specification[Z].http://www.OPCfoundation.org.2002

[3] Cai Siwen, Qi Yaobin, et al. OPC client design and its application in monitoring systems [J]. Microcomputer Information. 2007, 5-1: 106-108

[4] Xiong Wangzhi, Jiao Qingsong, et al. Research and design of OPC data acquisition server [J]. Microcomputer Information. 2007, 3-1: 24-25

[5] B&R Automation Studio help. pviopc.2004

[6] Dai Pengfei, Wang Shengkai, et al. Test Engineering and LabVIEW Applications [M]. Electronic Industry Press. 2006.5

[7]National Instruments. LabVIEW User Manual[M].Temas: National Instruments,2003

Read next

CATDOLL 126CM Alisa (TPE Body + Hard Silicone Head) Customer Photos

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22
CATDOLL Yuki Hard Silicone Head

CATDOLL Yuki Hard Silicone Head

Articles
2026-02-22
CATDOLL 128CM Lola

CATDOLL 128CM Lola

Articles
2026-02-22