The data we analyze or collect in LabVIEW are usually functions of time. For example, we may want to know how the temperature changes over time during a day, or what the changing waveform looks like after being plotted on the time axis.
LabVIEW has some special data types that can be used to help general users analyze or display data in the form of curves. These special data types are time stamp, waveform, and dynamic data
Time Stamp
The timestamp data type is used to store absolute date/time values, such as the time when data was collected. It has very high precision, with 19 digits of precision for both the integer and fractional parts of the counted seconds.
Although we can store and display time-scale values by setting the display mode of a numeric control to date/time, the numeric control saves relative values, while the time-scale control saves absolute values.
In LabVIEW, we can use the Get Date/Time In Seconds function to get the current time value. A time control is shown below:
The time scale is a means of storing absolute time with high precision, and the time scale control can be used to view and modify the time scale value. The time scale control can be found in the Modern>>Numeric sub-panel of the Controls control panel.
You can increase or decrease the value of the time scale by clicking the up and down arrows on the left side of the time scale control you want to modify. Or you can directly type a value on the keyboard to replace the current value of the time scale. You can also right-click on the time scale control and select Data
However, there is a more interesting way to modify the time scale, which is to click the date/time browsing button on the right side of the time scale control. After clicking this button, the following date and time setting dialog box will pop up. From this dialog box, we can easily use this calendar-style interface to modify the date and time values of the time scale.
This dialog box can also be opened by right-clicking the mouse on the time scale control and selecting
Relative time calculation
Sometimes we also need time calculations. For example, in the following flowchart, we use the subtraction function to calculate the relative time between two time scales.
In this way, we can test the execution time of certain program codes. For example, we can get a time stamp value before a VI starts and a time stamp value after the VI ends. By subtracting these two values, we can know the specific execution time of this VI.
In addition, we can also perform addition operations on the time stamp data, adding the relative time to the old time stamp value to obtain a new time stamp value. This procedure will not be demonstrated again.
Converting between time scale and numerical value
As shown in the previous two examples of time stamp subtraction, we can find that the time stamp and the value data types are closely related. In some cases, we need to convert between these two data types. When the addition and subtraction functions operate on time stamp data, the functions either match the time stamp type (because these two functions are reusable) or force the time stamp to be converted to a double-precision floating point number. Sometimes, we also want to perform this conversion operation directly. We can find the To Double Precision Float function on the Programming>>Numeric>>Conversion sub-panel of the function VI panel to convert the time stamp data to a double-precision floating point number. Or find the To Time Stamp function on the Programming>>Numeric>>Conversion sub-panel to convert a value to time stamp data (this function can also be found on the Programming>>Timing sub-panel).
These two functions are shown in the figure below:
The To Double Precision Float function here can convert any numeric data into a double-precision floating point number.
Waveforms
In many engineering and scientific applications, the data that needs to be processed is a set of values that change with time. For example, an audio signal is a pressure value that changes with time, an electrocardiogram is a voltage value that changes with time, the surface of a falling water drop is the value of its xyz coordinates that changes with time, and the digital signal commonly used in computers is a three-dimensional binary value that changes with time. LabVIEW provides the waveform data type to organize and process these time-varying signals. A waveform data not only allows you to store the value of the data, but also to store the time stamp value when the first data is acquired, the interval time between each data point, and the data's notes. It is similar to other data types in LabVIEW and can perform addition and subtraction operations, as well as other operations directly on the waveform. You can select the corresponding control in the I/O Control Panel to create a Waveform or Digital Waveform type control on the VI front panel.
The figure above shows how a waveform control appears on the front panel and in the block diagram. The figure below shows how a digital waveform control appears on the front panel and in the block diagram. We can see that in the block diagram, the icon of the waveform control is brown/orange and the icon of the numeric waveform control is green.
In these two icons, the analog waveform is a waveform similar to a sine wave, and the numerical waveform is a square wave. In addition, their colors are different, so it is easy to distinguish them.
By carefully examining the waveform data type, we can find that it is actually a special cluster type of data. This cluster contains four elements: Y, t0, dt, and Attributes. The details are as follows:
- Y: This element is the data that changes over time. For an analog waveform, this is a one-dimensional array whose elements are numerical data points. This data point can be a single point or another waveform, depending on the operation performed. The element data type of a one-dimensional array of analog signal type is double-precision floating point number. Discrete signals are called "digital" signals. Discrete signals are generally signals with only two states, such as TRUE or FALSE, 0 or 5V, on or off, etc. For discrete signals, we need to use digital waveforms. For digital waveforms. The Y element is digital data. You can imagine it as a table of binary values, with columns as digital lines and rows as variable values.
- t0: This element is a time stamp value that identifies the time when the first point in the Y array is collected (relative to the current system time). It is also called the initial time or initial time stamp.
- dt: Δt, pronounced as "delta T" (haha, just a little humor). It is used to represent the time interval between two adjacent data points in the Y array.
- Attribute: This element is hidden by default and can only be seen by right-clicking on the waveform and selecting Visible Items>>Attribute from the context menu. The attribute element is optional and is a variable data type quantity that allows you to conveniently bundle custom information, such as device number, channel number, etc. This element does not affect the presentation of the waveform data or the Y and time values.
Differences between Waveforms and Arrays
In many cases, you can think of a waveform as a one-dimensional array that stores data as well as some information about the time of the data point and the sampling time. Waveform data is often used in analog signal acquisition.
In fact, you can also use arrays to store your data instead of waveform data. However, waveform data has the following advantages over array data:
- t0 identification: If there is no t0, you will not know when your data was obtained. Waveform data will automatically return the date and time of data acquisition in t0, which provides the real-world time of your data.
- Easier to draw: Waveform data also simplifies drawing data curves. In older versions of LabVIEW, you must bind the value of the initial point (x0) and the interval between two points (delta x) to your data (Y array) to complete the work of drawing a curve. Now the waveform data directly includes these elements, and you can draw the graph by simply connecting the waveform data to the curve graph control.
- Easier multi-curve graphing: Waveform data also simplifies the graphing of multiple curves. In previous versions of LabVIEW, you had to bind the x0, delta x, and Y arrays to each curve and then create an array with them before you could graph a multi-curve. If you use waveform data, you can simply wire a 1D array of waveform data to a graph control to graph multiple curves.
Waveform function
The Waveform panel under Programming in the LabVIEW function panel contains all functions for waveform data operations, as shown in the following figure:
The Get Waveform Components and Build Waveform functions here are used to get or set the waveform elements of analog, array waveforms, and digital values respectively.
The Get Waveform Element function can return the waveform element you need. You can right-click on the function node and select Add Element and then left-click to select the waveform element you need. This function is extensible.
The Create Waveform function can be used to create a new waveform or modify an existing waveform. If you do not connect an input to the waveform input, the function will create a new waveform based on the input data. If you connect a waveform to this input, the function will modify the waveform based on the parameters you enter. This function is also extensible.
Both functions are reusable and can operate on analog waveforms, digital waveforms, and digital data. The waveform input of the function will automatically convert according to the input waveform.
In addition, there are many functions for operating waveforms. You can refer to the LabVIEW's built-in help files or examples to familiarize yourself with them.
Dynamic Data
Almost all Express VIs for acquiring, analyzing, manipulating, and generating signals use a special data type to transfer signal data, which is dynamic data. Simply put, dynamic data is the waveform data of one or more channels. In fact, you can also imagine dynamic data as just an array of simple analog waveforms, represented by a smart line. However, in actual use, dynamic data is indeed very smart. For example, it is very simple to merge several dynamic data into one dynamic data.
In LabVIEW, when you connect a dynamic data line to another dynamic data line, LabVIEW will automatically add a merge signal function to merge the two signal lines into one signal line.
The functions for dynamic signal operations are all located in the Express>>Signal Manipulation sub-panel. You can familiarize yourself with the use of these functions through the help file.
Previous article:Projects in LabVIEW
Next article:Waveform Chart in LabVIEW
Recommended ReadingLatest update time:2024-11-16 13:57
- 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)
- 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
- Ride: Which country will be the ultimate winner in 5G? Reply to this post and give points
- How to clearly mark chip pins with multiple functions in the schematic library?
- The charging current of IP5306 is 2.1A. Will it explode if it charges a 3.7-4.2V, 1000mAH, 1C lithium battery?
- TMS320F28369D Review Summary
- Girl with spinal muscular atrophy feeds horse with Kinova robotic arm
- 【EETALK】What do you think about Apple starting to research GaN chargers?
- Homemade IHM08M1 board based on FOC SDK5.3 library BLDC or PMSM motor drive: program + schematic + BOM and other all open source sharing
- How to convert the UCF file of FSM and MLC function configuration of LSM6DSOX into C code and embed it into MCU?
- About STM32 SDRAM reading and writing issues
- Live: TI Robot System Learning Kit is sweeping campuses. Can it become a practical tool for university electrical engineering courses?