Time Stamps, Waveforms, and Dynamic Data in LabVIEW

Publisher:CaptivatingEyesLatest update time:2016-08-03 Source: eefocusKeywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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 data is used to store the time information in a waveform, and multiple waveforms can be saved in dynamic data. Due to the natural dependence between time stamp, waveform, and dynamic data, we will introduce them together in this article.

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:

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++

 

 

  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 Operations>>Set Time to Now in the right-click menu to set the time scale value to the current date and time.

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++Date/Time Browse Buttons

  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.

 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++
 

 

   This dialog box can also be opened by right-clicking the mouse on the time scale control and selecting Data Operations>>Set Time and Data from the right-click menu. For time scale constants and indicator type controls that do not have date/time browsing buttons, using this right-click menu is the most appropriate method.

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.

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++

 

 

  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:

 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++
 

 

  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. 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++

 

  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.

 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++
 

 

        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: 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++

 

 

  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. 

 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++
 

 

  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.

 

Time Stamps, Waveforms, and Dynamic Data in LabVIEW - Senple Chan - Life++
 

 

 

  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.


Keywords:LabVIEW Reference address:Time Stamps, Waveforms, and Dynamic Data in LabVIEW

Previous article:Projects in LabVIEW
Next article:Waveform Chart in LabVIEW

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

Labview software counter and FIFO BUFFER
There are a large number of timers and counters available in PLC programming. Friends who do industrial automation control often worry about not being able to find similar familiar functions when programming in LABVIEW. In fact, the logic functions provided by LABVIEW itself are very powerful, far exceeding PLC.  
[Test Measurement]
Labview software counter and FIFO BUFFER
Labview as host computer
   I'm currently working on a host computer for a Bluetooth car. Its main function is to control the car to move forward, backward, turn left, turn right, turn on the lights, and rotate three servos through communication with the Bluetooth serial port. In addition, wireless routing is used to transmit real-time video t
[Test Measurement]
Introduction to Multisim Automation Using the LabVIEW Multisim Connectivity Toolkit (ß Version)
This document describes the LabVIEW Multisim Connectivity Toolkit (ß Edition). Available from ni.com/labs, the toolkit is a wrapper around the Multisim Automation API. With this set of toolkit VIs for LabVIEW, you can create applications that acquire circuit simulation data. In this white paper, you will learn tips
[Test Measurement]
Introduction to Multisim Automation Using the LabVIEW Multisim Connectivity Toolkit (ß Version)
In-depth exploration of LabVIEW - binary files in the file series
Binary files are the most common files in computer files. They occupy the smallest space and are suitable for continuous storage of large amounts of data. At the same time, their storage format is basically the same as or similar to the storage format of data in memory. In many cases, they are even memory mappings. The
[Test Measurement]
In-depth exploration of LabVIEW - binary files in the file series
Developing a Part Finishing and Inspection System Using NI Smart Cameras and LabVIEW
After removal, the robot uses an NI 1722 smart camera to randomly inspect for surface defects such as cracks, dents, scratches, and machining marks on the surface. challenge: Automatically remove burrs and perform final inspection on turbine wings of aircraft engines. Solution:
[Test Measurement]
Developing a Part Finishing and Inspection System Using NI Smart Cameras and LabVIEW
Use LabVIEW system to develop and implement the design of thermal dilatometer testing system
1 Introduction Most of the thermal dilatometer test systems in China are developed using VC. The programming process is complicated, and the communication between instruments is very cumbersome and takes a lot of time. The virtual instrument proposed by the American NI Company is a comprehensive testing technology. It
[Test Measurement]
Use LabVIEW system to develop and implement the design of thermal dilatometer testing system
Labview programming skills - how to process data bits
Bit operation is a common problem in automation control. Recently, I saw someone on the forum mention the problem of extracting the upper and lower four bits of a byte. Today, let's take a closer look at the bit operation. Bit is not equal to the Boolean value BOOLEAN in LABVIEW, which occupies one byte, the same as
[Test Measurement]
Labview programming skills - how to process data bits
Labview programming skills -----labview and INI files
Before WIN95, WINDOWS had not introduced the concept of registry. WINDOWS used INI files to store computer-related configurations. In the API, WINDOWS provided a wealth of API functions to operate INI files. There is also a special subcategory in LV that encapsulates these API functions, which is very convenient to use
[Test Measurement]
Labview programming skills -----labview and INI files
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号