LabVIEW is multi-threaded. There are many ways to exchange data between two threads. Process (PROCESS) and thread (THREAD) are two different concepts. When we start an executable file, we actually start a process. The process manager of WINDOWS can observe the currently active processes. The exchange of data between processes can be simply understood as the exchange of data between multiple executable files.
There are several ways to exchange data between processes: clipboard (CLIPBOARD), dynamic data exchange (DDE), memory mapped file (MAP FILE) and general files. Of course, TCP/IP, SHARE VARIABLE, DATASOCKET can also be used, but these are all network data exchange and are not suitable for local process communication.
In a previous article, we have introduced how to use the clipboard for communication. Today, we will introduce dynamic data exchange (DDE).
DDE (Dynamic Data Exchange), that is, dynamic data exchange, is a complete communication protocol on the Windows platform, which enables applications to exchange data and send instructions to each other. The DDE process is a dialogue process between two programs, one party asks a question to the other party and then waits for an answer. The party that asks the question, that is, the application that requests to be informed of the information, is called the client, and the party that answers, that is, the application that provides the information, is called the server. An application can be both a client and a server at the same time: when it requests data from other programs, it acts as a client; when other programs need it to provide data, it becomes a server. But at a certain moment, an application can only act as a client or a server.
The content of the DDE conversation is agreed upon through three identifiers: ① Server Name (Service Name): Each application of the DDE source has a unique server name, usually an executable file without a suffix; ② Topic (Topic): Some data units that are meaningful to the source program, that is, the topic of the conversation. Many applications use the document name as the topic of the DDE conversation; ③ Item (Item): The data actually transferred between two applications in the DDE conversation. Before establishing DDE, the client program must fill in the three identifiers of the service program.
There are three types of DDE links: ① Hot link: The server sends data in the project specifically set for DDE dialogue. When the data changes, the link will act in real time and automatically update the data; ② Cold link: When the data changes, the client must explicitly request an update before the data will be updated; ③ Warm link: When the data changes, the server notifies the client, and the client decides whether to update the data based on its own requirements.
DDE is essentially implemented by sending messages. In VC and CVI, event callback functions can be registered to achieve automatic data exchange, but unfortunately LABVIEW does not provide an event-driven method for DDE. Just like its serial port operation, it is all done through polling (POLLING), so it involves the problem of DDE speed coordination between two processes.
DDE is an important way of inter-process communication in the early days of WINDOWS. It is not used much now, but many applications, such as OFFICE, MATLAB, etc., including various popular configuration software, still provide support for DDE, so it is necessary to understand it.
After 7.1, LABVIEW cannot find the DDE library in the template and needs to be manually added to USER LIB.
C:Program FilesNational InstrumentsLabVIEW 8.5vi.libPlatformdde.llb
is mainly divided into two parts: client and server, client and server VI.
DDE data exchange must first start the server, otherwise the client cannot connect.
The server operation process is:
register server---》register ITEM----》set ITEM value-----》cancel ITEM registration---》cancel server registration
Corresponding client reading data block diagram
Note that the server cycle is updated every 500MS, and the client is updated every 500MS. The server and client are basically synchronized. If the client speed is higher than the server, it will cause the same data on the server to be read multiple times. Similarly, if the server runs fast and the client runs slowly, data will be lost. This is the disadvantage of no event response. It is difficult to ensure the synchronization of sending and receiving. Therefore, the above program is only suitable for situations where data exchange requirements are not high, such as monitoring.
DDE is a hierarchical structure, SERVER--》TOPIC---》ITEM.
A SEVER can include multiple TOPICs (similar to a group), and each TOPIC can include multiple ITEMs (projects). We can register multiple TOPICs and multiple ITEMs in a loop to achieve batch data exchange.
In the above figure, 10 ITEMs are registered for TOPIC1 at the same time through a loop, namely ITEM0----》ITEM9, and data is written to ITEM0--》ITEM9 in the main loop.
Similarly, we can classify the data we have to communicate into multiple SERVERs and multiple TOPICs in detail to exchange a large amount of data.
The advanced synchronization technology of DDE will be further introduced in subsequent articles.
Keywords:labview DDE
Reference address:In-depth exploration of LabVIEW--Using DDE to realize data exchange between processes
There are several ways to exchange data between processes: clipboard (CLIPBOARD), dynamic data exchange (DDE), memory mapped file (MAP FILE) and general files. Of course, TCP/IP, SHARE VARIABLE, DATASOCKET can also be used, but these are all network data exchange and are not suitable for local process communication.
In a previous article, we have introduced how to use the clipboard for communication. Today, we will introduce dynamic data exchange (DDE).
DDE (Dynamic Data Exchange), that is, dynamic data exchange, is a complete communication protocol on the Windows platform, which enables applications to exchange data and send instructions to each other. The DDE process is a dialogue process between two programs, one party asks a question to the other party and then waits for an answer. The party that asks the question, that is, the application that requests to be informed of the information, is called the client, and the party that answers, that is, the application that provides the information, is called the server. An application can be both a client and a server at the same time: when it requests data from other programs, it acts as a client; when other programs need it to provide data, it becomes a server. But at a certain moment, an application can only act as a client or a server.
The content of the DDE conversation is agreed upon through three identifiers: ① Server Name (Service Name): Each application of the DDE source has a unique server name, usually an executable file without a suffix; ② Topic (Topic): Some data units that are meaningful to the source program, that is, the topic of the conversation. Many applications use the document name as the topic of the DDE conversation; ③ Item (Item): The data actually transferred between two applications in the DDE conversation. Before establishing DDE, the client program must fill in the three identifiers of the service program.
There are three types of DDE links: ① Hot link: The server sends data in the project specifically set for DDE dialogue. When the data changes, the link will act in real time and automatically update the data; ② Cold link: When the data changes, the client must explicitly request an update before the data will be updated; ③ Warm link: When the data changes, the server notifies the client, and the client decides whether to update the data based on its own requirements.
DDE is essentially implemented by sending messages. In VC and CVI, event callback functions can be registered to achieve automatic data exchange, but unfortunately LABVIEW does not provide an event-driven method for DDE. Just like its serial port operation, it is all done through polling (POLLING), so it involves the problem of DDE speed coordination between two processes.
DDE is an important way of inter-process communication in the early days of WINDOWS. It is not used much now, but many applications, such as OFFICE, MATLAB, etc., including various popular configuration software, still provide support for DDE, so it is necessary to understand it.
After 7.1, LABVIEW cannot find the DDE library in the template and needs to be manually added to USER LIB.
C:Program FilesNational InstrumentsLabVIEW 8.5vi.libPlatformdde.llb
is mainly divided into two parts: client and server, client and server VI.
DDE data exchange must first start the server, otherwise the client cannot connect.
The server operation process is:
register server---》register ITEM----》set ITEM value-----》cancel ITEM registration---》cancel server registration
Corresponding client reading data block diagram
Note that the server cycle is updated every 500MS, and the client is updated every 500MS. The server and client are basically synchronized. If the client speed is higher than the server, it will cause the same data on the server to be read multiple times. Similarly, if the server runs fast and the client runs slowly, data will be lost. This is the disadvantage of no event response. It is difficult to ensure the synchronization of sending and receiving. Therefore, the above program is only suitable for situations where data exchange requirements are not high, such as monitoring.
DDE is a hierarchical structure, SERVER--》TOPIC---》ITEM.
A SEVER can include multiple TOPICs (similar to a group), and each TOPIC can include multiple ITEMs (projects). We can register multiple TOPICs and multiple ITEMs in a loop to achieve batch data exchange.
In the above figure, 10 ITEMs are registered for TOPIC1 at the same time through a loop, namely ITEM0----》ITEM9, and data is written to ITEM0--》ITEM9 in the main loop.
Similarly, we can classify the data we have to communicate into multiple SERVERs and multiple TOPICs in detail to exchange a large amount of data.
The advanced synchronization technology of DDE will be further introduced in subsequent articles.
Previous article:In-depth exploration of LabVIEW - using DDE to achieve data exchange between processes Part 2
Next article:In-depth exploration of labview--the basic concepts of OPC series
Recommended ReadingLatest update time:2024-11-16 13:50
LabVIEW in-depth exploration of how to make multiple event branches execute the same function
In actual applications, we often encounter the problem of multiple different event sources that need to trigger the same event. The most common problem is the program's menu items and toolbar buttons. Usually, a toolbar button corresponds to an item in the menu bar, and the two have the same function. In C language
[Test Measurement]
Broken rotor bar detection of asynchronous motor based on LabVIEW
The broken rotor bar fault of cage asynchronous motor will lead to the deterioration of motor running performance and cause certain losses to production development. The probability of broken rotor bar fault is as high as 10%. Therefore, it is necessary to detect and warn in time at the early stage of fault developm
[Test Measurement]
Realize quantitative testing and time-frequency analysis based on LabVIEW software and computer sound card
In the field of electronic measurement, signal generators and oscilloscopes are one of the most basic and widely used electronic measurement equipment. Their functions are to provide electrical signal sources that meet certain technical requirements for electronic measurement and to graphically display electrical sign
[Test Measurement]
Analysis of the design principles of wireless monitoring remote medical system
This paper introduces a wireless remote medical monitoring system based on GPRS technology. With SPCE061A as the main control chip, the data acquisition module and the GPRS communication module are combined to connect to the Internet wirelessly. The monitoring center receives the data and saves it in the database
[Medical Electronics]
Design of periodic signal and random signal amplitude eigenvalue obtaining system based on LabVIEW
introduction
LabVIEW has two basic windows, the front panel window and the flowchart window. The front panel window is used to set control objects and display objects, which is equivalent to the display screen or pointer of a conventional instrument; the flowchart window is used to write and display the graphic
[Test Measurement]
Stepper Motor Control Based on LabVIEW
A stepper motor is an electromechanical element that converts an electrical pulse signal into an angular displacement or a linear displacement. It is widely used in industrial automation control, CNC machine tools, robots and other fields. In remote experimental systems, it is often necessary to use stepper motors to
[Test Measurement]
Communication simulation based on LabVIEW (Figure)
Introduction
---LabVIEW, launched by NI, is an excellent object-oriented graphical programming language. It uses icons instead of text codes to create applications and has a large number of VI libraries for communicating with other applications. As one of the most widely used data acquisition and control development e
[Test Measurement]
Developing a novel portable smart greenhouse using graphical system design
A greenhouse in Mexico is about to use a portable smart greenhouse system
author:
Pedro Ponce - Monterrey Institute of Technology
industry:
Life Sciences, Consumer Products, Scientific Research
product:
cRIO-9014, NI 9265, NI 9215, USB-6211, LabVIEW
challenge:
Create a smart system
[Test Measurement]
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
Recommended Content
Latest Test Measurement Articles
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- A new version of micro:bit (V2) will be released soon
- What is this error?
- Have my friends in Beijing grabbed any Winter Olympics souvenirs?
- Some Problems of PMOS as Anti-Reverse Connection Circuit
- Recruiting analog IC design engineers
- Does anyone know how to connect this refrigerator starter?
- IAR msp430 memory allocation keywords
- Where are my favorite articles? Where are the collectors?
- In addition to round and square, are there other shapes of NFC tags?
- About Bandgap Reference and Zener Reference