Application of OPC Technology in LabVIEW 8.0 DSC Module

Publisher:leader5Latest update time:2015-09-15 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Preface

With the introduction of computers in industrial control systems, the software and protocols used in automatic industrial control have become increasingly complex. However, any complex technology will eventually move towards a unified standard, so major industrial control manufacturers around the world have jointly launched the OPC standard, which is specifically used for automated industrial control. Along with it came various configuration software that supports OPC technology. National Instruments of the United States, NI, was not far behind and launched the latest LabVIEW 8.0 DSC module in 2006 to support OPC technology. Since LabVIEW, as a development software, has programming flexibility that ordinary configuration software cannot match, LabVIEW 8.0 and its DSC module make up for the fatal flaws of ordinary configuration software in the field of industrial testing and automation.

1 Introduction to OPC Technology

OPC (OLE for Process Control) is an industrial standard that is the result of cooperation between many of the world's leading automation and software and hardware companies and Microsoft. This standard defines how to exchange real-time automation data between PC-based clients using Microsoft operating systems. Traditionally, hardware and software communication is implemented by writing custom interfaces and drivers directly in the software, but this is not only expensive but also not very versatile. With OPC technology as a communication "mediator", everything becomes very simple. Software no longer needs to write drivers for each type of hardware, all it needs to do is communicate with an OPC Server that meets industrial standards. Hardware providers no longer have to worry about whether many software can support their hardware, they only need to provide a standard OPC Server that supports the hardware. Therefore, OPC technology avoids duplication of development, greatly reduces costs, speeds up software development and improves efficiency. Today, OPC specifications have been used in thousands of projects by hundreds of companies. The organization that manages the standard is the OPC Foundation. The foundation was established by five companies in 1996, and now there are 360 ​​members around the world promoting and applying this technology.

Specific advantages of OPC:

1) Adopting the standard Windows system interface, no matter what form the field equipment exists in, customers can access it in a unified way, thus realizing the openness of the system and facilitating the interface with other systems.

2) The OPC specification is based on OLE/DCOM, which supports network protocols such as TCP/IP. Therefore, each subsystem can be physically separated and distributed on different nodes of the network.

3) Adopting OPC specifications facilitates system configuration and greatly simplifies system complexity, which can greatly shorten the software development cycle, improve the reliability and stability of software operation, and facilitate system upgrades and maintenance.

2 LabVIEW 8.0 DSC Module Introduction

LabVIEW is an industry-leading industrial standard software tool for developing test, measurement and control systems. It is an intuitive graphical programming language designed for engineers and scientists. It integrates development software with various measuring instrument hardware and computers to build virtual instrument systems to form user-defined solutions. After 20 years of evolution and improvement, LabVIEW has established its dominant position in the field of PC-based measurement automation and has become the industry's de facto standard. The latest LabVIEW 8 contains hundreds of new features, and the update intensity exceeds any previous version. Its additional DSC (Datalogging and Supervisory Control) data logging and monitoring module is designed for SCADA systems. It can easily communicate with OPC Servers and can also generate its own OPC Servers. In addition, there are many common SCADA functions, such as configuration-based alarms and events, user-level security mechanisms for applications, graphical development of distributed monitoring and control, real-time and historical data tracking, built-in networking to facilitate data sharing and integration with third-party devices, and networked databases for distributed data recording. Since the DSC module can be seamlessly integrated with the LabVIEW development environment, the SCADA system developed based on LabVIEW 8.0 and its DSC module can fully utilize the powerful data processing and analysis functions of LabVIEW, and has incomparable advantages over traditional SCADA configuration software.

Figure 1 describes the structure of a SCADA system based on OPC and LabVIEW DSC module.

525800457

Figure 1 Schematic diagram of the SCADA system structure based on OPC Server and LabVIEW 8.0 DSC module

3 Accessing OPC Server via LabVIEW 8.0 DSC Module

There are three ways to communicate with OPC Server through LabVIEW: 1) Access OPC Server through ActiveX Automation Interface; 2) Communicate with OPC Server through NI DataSocket technology; 3) Communicate with OPC Server using its DSC module. The first two methods are only suitable for connecting with a small number of OPC tags. Because it is necessary to write multiple repetitive codes or read and write through For loops, the reading and writing speed will decrease when the number of points increases, making the system difficult to maintain. Through the built-in communication mechanism with OPC Server in the DSC module, programming becomes quite easy, and its programming scale and reading and writing speed are not limited by the number of points. Therefore, only the third method is introduced in detail here. If readers are also interested in the first two methods, please refer to the LabVIEW 8.0 User Manual.

3.1 Installation and Configuration of OPC Server

Most hardware equipment manufacturers that require computer acquisition and control provide OPC Servers for their equipment. At present, many OPC Server suppliers have even developed OPC Servers that connect to ODBC data sources, through which users can access the database by accessing the OPC Server. At present, most OPC Servers run under Windows, and a few OPC Servers can run under Linux. Just install it according to the manual provided by the provider. Due to the use of DCOM technology, other computers on the network can usually access your OPC Server. But if your operating system is WinXP SP2, you must make some corresponding settings. Please refer to relevant documents for details.

Most OPC Servers use XML configuration files for related configuration, such as hardware address, related parameters, etc. After configuration, restart the computer, and the OPC Server will automatically start as a Windows service when the computer starts. You can use any OPC client to access the OPC Server and browse the OPC tag information. For example, NI provides Server Explorer for free (you can download it for free on the NI website).

3.2 Establishing a connection with OPC tags

The way to connect to OPC tags through LabVIEW 8.0 DSC module is completely different from previous versions. LabVIEW 8.0 introduces the concept of shared variables. Shared variables can be bound to OPC tags on any computer locally or on the network. Once bound, users only need to operate shared variables as ordinary variables without having to know which computer's OPC tag the shared variable is communicating with.

Binding to OPC tags is very simple.

1) Create a new LabVIEW Library.

2) Create a new I/O Server in the library. During the creation process, you can browse which OPC Servers can be connected on the local computer or on the network, and then bind the I/O Server to the OPC Server you need to connect to.

3) Create a new shared variable in the Library and bind it to the OPC tag listed in the I/O Server. At the same time, you can also set some other properties of the shared variable, such as: whether to store, alarm upper and lower limits, variable description, user access permissions, etc.

After the binding is completed, the shared variable can be used as a normal variable in LabVIEW programming. There are three ways to read OPC tags through shared variables. The first method is to bind directly through the front panel. Drag the newly created shared variable directly to the VI front panel, and then let the VI run continuously to obtain the value of the OPC tag in real time. The first method is the simplest, but it is not easy to manage when there are many variables. The second method is to drag the newly created shared variable to the VI back panel, and then you can program it like a general variable. This method is also simple, but it is not conducive to management. The third method is introduced below. This method uses the event method provided by the DSC module. When the value of the OPC tag connected to the shared variable changes, an event will be triggered, and the value of the OPC tag can be read by programming the event. Because the event method is used, the program does not need to read the value of the OPC tag continuously in a polling manner, but only triggers the corresponding handler when the value of the OPC tag changes. Therefore, this method is the most efficient, and no matter how many shared variables there are in the Library, the program can read all OPC tag values ​​into the same array without modification. The LabVIEW program of this method is shown in Figure 2.

525457230

Figure 2 Using the shared variable event feature to read OPC tag data

However, this event can only be triggered when the value of the OPC tag changes. Many OPC tags also use Quality to indicate whether their current value is correct. For example, when the OPC Server is disconnected from the hardware, the Quality of its tag will be displayed as "bad". Therefore, when the value of the OPC tag changes from "good" to "bad", the above program cannot detect it. To solve this problem, we can only use DataSocket to read the status of its Quality in real time. As shown in Figure 3.

525426359
Figure 3 Using DataSocket to read the Quality of OPC tags

4. Use LabVIEW to build your own OPC Server

When users develop their own hardware devices or some hardware manufacturers do not provide OPC Servers, it is very important to write OPC Servers for the hardware devices. However, dedicated OPC Server development tools are generally expensive and difficult to use. It is very simple to generate your own OPC Server through LabVIEW. We can first communicate directly with the driver of the hardware device through LabVIEW. Then put the read data in the OPC Server as individual OPC tags and publish them. [page]

The following uses a simulated water tank system as an example to introduce how to generate your own OPC Server. The water tank has an inlet valve and an outlet valve. Users can adjust the valve flow rate through the slider, and the water tank calculates the current water level in real time based on the flow rates of the two valves. See Figure 4.

525606205

Figure 4 Simulated water tank interface

Then create a new I/O Server in the Library and connect it to the simulated water tank VI. During the creation process, LabVIEW automatically obtains the control controls and display controls in the simulated water tank program as alternative OPC tags, and the user can select several of the controls as OPC tags. For example: Tank Volume, Input Flowrate, Tank Valve can be used as readable and writable OPC tags, and Tank Level, Tank Output Flowrate can be used as read-only OPC tags. After the I/O Server is created, it can run as a real OPC Server, and these tags can be browsed in any OPC client tool. From now on, you don't have to worry about providing hardware drivers for each user. You only need to provide a standard OPC Server.

5. Conclusion

In summary, it can be seen that through the LabVIEW 8.0 DSC module, it is very easy to access the OPC Server, and it is also convenient to generate your own OPC Server. Since the DSC module can be seamlessly integrated with LabVIEW, the SCADA system implemented by using the powerful programming features and rich hardware interfaces of LabVIEW 8.0 can realize some functions that cannot be realized or are difficult to realize with general configuration software, such as complex logic processing, data analysis, etc. The slow control system in the second phase of the Beijing Electron-Positron Collider, a national key project in which the author participated, has adopted a large number of technologies combining OPC and LabVIEW, which not only reduces costs, but also improves development speed and reduces maintenance difficulty. With the promotion of LabVIEW 8.0 and its DSC module, it is believed that it will play an increasingly important role in the field of computer distributed monitoring.

[Reprint] Application of OPC Technology in LabVIEW 8.0 DSC Module[Reprint] Application of OPC Technology in LabVIEW 8.0 DSC Module[Reprint] Application of OPC Technology in LabVIEW 8.0 DSC Module[Reprint] Application of OPC Technology in LabVIEW 8.0 DSC Module
 

Reference address:Application of OPC Technology in LabVIEW 8.0 DSC Module

Previous article:Frequently asked questions for Labview beginners
Next article:Difference between LabVIEW and LabWindows

Recommended ReadingLatest update time:2024-11-16 20:57

Electric vehicle battery monitoring and early warning system based on LabVIEW
As the core component of electric vehicles, how to effectively manage and utilize the energy of batteries and increase the service life of batteries has become a key issue. This paper introduces a battery information acquisition hardware platform based on STC89C52. By improving the A/D conversion, serial communication,
[Microcontroller]
Electric vehicle battery monitoring and early warning system based on LabVIEW
Design of DC Motor Fuzzy Control System Based on LabVIEW
  Fuzzy control technology is a computer digital control based on fuzzy set theory, fuzzy language variables and fuzzy logic reasoning. It first appeared in the 1960s and developed rapidly in the following decades. At present, fuzzy control technology is widely used in the control field. LabVIEW is a graphical program
[Test Measurement]
Design of DC Motor Fuzzy Control System Based on LabVIEW
LabVIEW Programming Patterns (V) - Producer/Consumer Pattern (2)_VI Reentrancy
Before introducing the dynamic calling of VI, it is necessary to have a general understanding of the rules of LabVIEW in the process of executing VI. As we all know, LabVIEW represents independent VIs by the file name (VI Name) of the VI, not the path of the VI. Therefore, LabVIEW does not allow VIs with the same name
[Test Measurement]
LabVIEW Programming Patterns (V) - Producer/Consumer Pattern (2)_VI Reentrancy
Rapidly build medical equipment based on LabVIEW
The 21st century is the century of life and health. The rapid progress of life sciences has continuously promoted human understanding of their own health and diseases. How to develop innovative medical electronic equipment has also become one of the research hotspots. The research content of medical equipment involve
[Test Measurement]
Rapidly build medical equipment based on LabVIEW
How to connect to SQL Server database from client in LabVIEW_DSN method
      Problem description: DSN, data source name, establish a data source to connect to the database.       Specific steps: For specific programming methods, refer to the UDL method. The following is the general process of establishing a data source       . Enter "Administrative Tools" in "Control Panel":    
[Test Measurement]
RF/communication physical layer research based on LabVIEW and NI USRP
   Figure 1: Overview of symbol, BER, SNR, current estimate, and transmission status information displayed on the detector before and after suppression.   "LabVIEW system design software is really good at parallel programming, and it is a great helper for developing signal processing and communication algorithms in
[Test Measurement]
RF/communication physical layer research based on LabVIEW and NI USRP
Research on the realization method of database establishment and management function in LabVIEW
  In LabVIEW, we use the ActiveX function to call the Microsoft ADO control, and then use the SQL language to access the database through the underlying ODBC interface function and ODBC database driver. The structural hierarchy is shown in Figure 1.     The goal of ADO is to access, edit, and update data sources
[Test Measurement]
Research on the realization method of database establishment and management function in LabVIEW
Humidity Sensitive Component Performance Test and Analysis System Based on LabVIEW
0 Introduction Humidity sensors are used for humidity monitoring and automatic control of local environments. In recent years, with the emergence of new materials (such as rare earth doping) and the production of nano-level components, people have increasingly studied their electrical characteristics, humidity s
[Test Measurement]
Humidity Sensitive Component Performance Test and Analysis System Based on LabVIEW
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号