In any programming language, there is the problem of data encapsulation. It can be seen everywhere in object-oriented programming languages. LABVIEW8.X adds the concept of some classes, which makes data encapsulation much easier. This is another topic.
An Action Engine, as I understand it, is a black box operation that can accept external commands and automatically perform corresponding operations. The specific execution process of the command is invisible to the outside world, similar to the concept of attributes and methods in a class.
For example, when driving, as a driver, you only need to use the steering wheel to control the direction, and use the accelerator and gear to control the speed. The driver does not care about how to achieve it, so the specific implementation process is opaque to the driver. This is the meaning of the actuator.
In essence, it is a mechanism based on message sending.
Windows is a typical example of using messages to send commands.
LRESULT SendMessage(
HWND hWnd, // target window handle
UINT Msg, // message to be sent
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
hWnd---is the window handle that receives the message Msg----message (command), wParam and lParam are the data to be passed.
In fact, the so-called Action Engine is also based on this principle.
Let's take a practical application problem to further illustrate. For simplicity, the message only uses the command method and does not transmit any data.
The general data acquisition card has an 8-bit digital output, each bit corresponds to an external output point, control motor, directional valve, etc.
We named them as: bit 0--->Relay 0, 1--->Relay 1 .....7---Relay 7. We need to set each bit to 0 or 1.
The following command groups can be compiled:
Relay0 On
Relay0 Off
...
Port On (All On)
Port Off (All Off)
Keep (can be changed, but not output)
Obviously we need an Enum type of data to describe the above commands. It is strongly recommended to use strict type def in custom controls so that if modifications are required, they can be automatically updated anywhere in the program.
We need to use the Function Global method to save a U8 data to represent this 8-bit output port.
The next step is to configure a CASE project for each command.
In this way, an AE is formed, which exists as a sub-VI and can be called very conveniently in other parts.
In this way, for the main loop, it only sends the corresponding command to AE, and the specific implementation process has nothing to do with the main loop, effectively encapsulating the data.
Previous article:Shift register and loop structure
Next article:Shift Register and Function Global
- 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?
- 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
- 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
- Question about the maximum current allowed by the EN pin of the LDO power chip
- Bose small speaker disassembly and repair
- Understanding Electromagnetic Radiation
- [Me and Yatli] + When a door closes outside, a new door opens here!
- Technological innovation promotes outdoor diagnosis and treatment
- We see that body fat detection, high-frequency radio frequency circuits, or ultrasonic detection all use sine waves instead of triangle waves,...
- MY-R16-EK166 FAQ Reference Manual
- 【XMC4800 Relax EtherCAT Kit Review】+Detailed tutorial for new DAVE projects
- WiFi 6 and “CHIP” will promote the popularization of the Internet of Things
- Ask a question about impedance testing