0% found this document useful (0 votes)
14 views38 pages

Analyzing and Presenting Data With LabVIEW

IntechOpen is a leading publisher of Open Access books, with over 5,200 titles and contributions from 128,000 international authors. The document discusses the capabilities of LabVIEW, a software designed for data acquisition, analysis, and presentation, highlighting its user-friendly interface and extensive library of functions. It outlines the process of acquiring, analyzing, and presenting data, as well as the various visualization tools available within LabVIEW.

Uploaded by

sevinc a-va
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views38 pages

Analyzing and Presenting Data With LabVIEW

IntechOpen is a leading publisher of Open Access books, with over 5,200 titles and contributions from 128,000 international authors. The document discusses the capabilities of LabVIEW, a software designed for data acquisition, analysis, and presentation, highlighting its user-friendly interface and extensive library of functions. It outlines the process of acquiring, analyzing, and presenting data, as well as the various visualization tools available within LabVIEW.

Uploaded by

sevinc a-va
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

We are IntechOpen,

the world’s leading publisher of


Open Access books
Built by scientists, for scientists

5,200
Open access books available
128,000
International authors and editors
150M Downloads

Our authors are among the

154
Countries delivered to
TOP 1%
most cited scientists
12.2%
Contributors from top 500 universities

Selection of our books indexed in the Book Citation Index


in Web of Science™ Core Collection (BKCI)

Interested in publishing with us?


Contact [email protected]
Numbers displayed above are based on latest data collected.
For more information visit www.intechopen.com
Chapter

Analyzing and Presenting Data


with LabVIEW
Ahmet Mavi, Ahmet Özmen and Mehmet Ertuğrul

Abstract

LabVIEW is an abbreviation for Laboratory Virtual Instrument Engineering


Workbench and allows scientists and engineers to develop and implement an inter-
active program. LabVIEW has been specially developed to take measurements,
analyze data, and present the results to the user. You determine what the device
looks like, rather than the manufacturer of the device. LabVIEW has a very large
library of functions and subprograms (subVIs) that can help you during your
programming and use without occupying memory. Hidden programming problems
that you may encounter in traditional programming languages are less common in
LabVIEW. LabVIEW also includes different applications such as serial device con-
trol, data analysis, data presentation, data storage and communication over the
internet. Analysis library; It includes versatile and useful functions such as signal
generation, signal processing filters, Windows statistics and regressions, linear
algebra and array arithmetic. Due to the graphical nature of LabVIEW, it is an
innate data presentation package. You can view the data in any form you want.
Chart, graph and user-defined graph are among the output options that can be used.
As a scientist or an engineer, you frequently measure physical changes such as
temperature, pressure, time, mass, electric current, light intensity, radioactivity etc.
You generally need to analyze and present the data. When you have large amounts
of data, you need to use software to analyze and present the data. LabVIEW makes
these actions easy for you. Because LabVIEW includes hundreds of built-in and
add-on functions you need that make it easy to create a user-friendly interface. In
this chapter, we focus on data analysis and presentation.

Keywords: data analysis, data presentation, report generation, DIAdem, OriginPro

1. Introduction

Almost all LabVIEW applications include 3 steps: (1) acquiring data, (2) analyz-
ing and processing the data, and (3) presenting the data in a report or on a chart/
graph (Figure 1).
Acquire: NI (National Instruments) is a global leader in computer-based data
acquisition. More than millions of data acquisition devices have been sold by NI.
LabVIEW developed by NI is a user friendly programming interface and easily
communicates to NI devices. Therefore, most of the scientists and engineers choose
LabVIEW for programming and NI devices for measurements.
Analyze: LabVIEW software has more than 600 built-in functions for signal
synthesis, frequency analysis, probability, statistics, math, curve fitting,

1
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 1.
Common steps in a VI.

interpolation, digital signal processing, and more. You can also reach more func-
tions from additional modules. Unfortunately, some modules are not free.
Present: After you acquire and analyze data, you generally want to present your
data. Data presentation means data visualization, report generation, data storage,
Web publishing, database connectivity, data management, and more. The
LabVIEW includes hundreds of functions and tools for data presentation. These
allow you to visualize data in a very simple and effective manner.

2. Analyze with LabVIEW

2.1 LabVIEW data analysis and math libraries

LabVIEW presents the VIs and functions on the Functions palette using menus.
When LabVIEW is installed, built-in menus appear on the Functions palette. Some
of them do not contain functions by default. After installed certain modules,
toolkits, and drivers, functions appear in the built-in categories. For example,
Measurement I/O menu does not contain NI DAQmx by default. If you want to
utilize its function, you must install NI DAQmx.
LabVIEW includes hundreds of built-in and add-ons functions for analysis. You
can find a short list of analysis functions below [1].
Measurement.
Waveform-Based**.
Averaged DC-rms.
Cycle average and rms.
Pulse transition (rise, slew, overshoot).
Pulse width/period/duty.
Pulse amplitude and levels.
Signal noise and distortion (SINAD) analyzer.
Harmonic distortion analyzer.
Cross spectra Sine tone measurement.
FFT spectrum.
Frequency response function.
Power spectrum.
Power spectral density.
Array-Based.
AC and DC Estimator.
Amp and frequency estimate.
Amp and phase spectrum.
Auto power spectrum.
Cross power spectrum.
Harmonic analyzer.

2
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Impulse response.
Network functions (avg).
Power and frequency estimate.
Power spectrum.
Scaled time-domain window.
Spectrum unit conversion.
Transfer function.
Signal Monitoring/Triggering.
Waveform-Based**.
Basic level trigger detection.
Limit testing.
Limit specification.
Limit specification by function.
Waveform peak detection.
Array-Based.
Peak detection.
Pulse parameters.
Threshold peak detector.
Signal Generation.
Windowing.
Digital Filters.

2.2 Statistics

1D, 2D, and 3D ANOVA.


Chi square distribution.
Contingency table.
erf(x) and erfc(x).
F distribution.
T distribution.
General histogram.
Histogram*.
Inverse chi square.
Distribution.
Inverse F distribution.
Inverse normal distribution.
Inverse T distribution.
Mean*.
Median*.
Mode*.
Moment about mean.
Mean squared error (MSE).
Normal distribution.
Polynomial interpolation.
Rational interpolation.
Root mean square (rms).
Spline interpolant/interpolation.
Standard deviation*.
Variance.
Signal Processing.
Autocorrelation.
Convolution.
Cross power.

3
LabVIEW - History, Applications, Current Trends and Perspectives

Cross correlation.
Decimate.
Deconvolution.
Derivative x(t).
Fast Hilbert transform.
Fast Hartley transform.
Integral x(t).
FFT/Inverse FFT (Re + Im).
Inverse fast Hilbert transform.
Unwrap phase Y[i] = Clip{X[i]} Y[i] = X[i-n].
Curve Fitting.
Exponential fit.
General least squares linear fit.
General polynomial fit.
Linear fit.
Nonlinear Lev-Mar fit.
1D and 2D linear evaluation*.
1D and 2D polynomial evaluation*.
Numeric integration.
Polar to rect/rect to polar.
Scale 1D/2D.
Find polynomial roots.
Mathematics/Numerical Methods.
Digital Waveform Analysis.
Digital signal subset.
Invert digital signal.
Uncompress digital signal.
Compress digital signal.
Digital signal size.
Search for digital pattern.
Compare digital signals.
Append digital signals.
Append digital samples.
Digital waveform to Boolean array.
Boolean array to digital waveform.
Waveform Conditioning.
*Denotes VIs that are shipped with the Base package of LabVIEW for Windows.
**Waveform VIs input a time-domain signal and output a scaled measurement.
We highly recommend that check the examples located in LabVIEW before
starting to create a VI for analysis. You can access the examples from NI Example
Finder (Help>> Find Examples … ). You can search the examples with keyword
(s) in NI Example Finder. It also allows you to visit ni.com for more examples.
We also recommend that if possible you should choose Express VIs for analysis.
An Express VI is a VI, which can be configured interactively through a dialog box.
Express VIs are user friendly. You can easily configure your analysis parameters. To
access to the dialog box, double-click to corresponding Express VI.
For analysis, you will frequently use Mathematics palette and Signal
Processing palette (Figure 2).
Statistics and Histogram Express VIs are located in Probability & Statistics
subpalette of Mathematics palette (Figure 3).
In the following example, VI simulates a DC signal with noise (Figure 4). VI also
generates a histogram and result of basic statistical analysis.

4
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 2.
Mathematics palette and signal processing palette.

Mathematics palette also contains Fitting subpalette (Figure 5). This palette
contains the following fitting VIs.

• Linear Fit VI

• Exponential Fit VI

• Power Fit VI

• Gaussian Peak Fit VI

• Logarithm Fit VI

5
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 3.
Probability & Statistics palette.

Figure 4.
Statistics and histogram express VIs in a VI.

• General Polynomial VI

• General Linear Fit VI

• Cubic Spline Fit VI

• Nonlinear Curve Fit VI

6
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 5.
Fitting VIs.

Figure 6.
Exponential fit.

You can use curve fitting for several reasons. For example, to reduce noise, to
find mathematical relationships among variables, to estimate the variable value
between data samples or out of data sample range.
The following simple VI plots data and Exponential fit (Figure 6). You can use
the other fitting VIs with the same manner.
You can use the Signal Processing VIs for spectrum analysis, signal generation,
digital filtering, and data windowing (Figure 7). It is located in Functions palette.
In Signal Processing palette, Waveform Measurements palette contains Tone
Measurements and Spectral Measurements Express VIs (Figure 8).
The following example in Figure 9, Tone Measurements Express VI finds
amplitude, frequency and phase of a signal which is generated by Simulate Signal
Express VI. In this example, Spectral Measurements Express VI generates the
power spectrum of the signal.

7
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 7.
Signal processing palette.

Figure 8.
Waveform measurements palette.

8
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 9.
Tone measurements and spectral measurements express VIs.

3. Present with LabVIEW

3.1 Visualize your data

LabVIEW includes tools for charting and graphing, 2D and 3D visualization


(Figure 10) [2].
LabVIEW has two ways to display data in 2D. These are Chart and Graph
(Figure 11).
A Waveform Chart remembers and displays a certain number of points by
storing them in a buffer. Waveform Chart displays received data in addition to
already existing data.
A Waveform Graph accepts arrays of data in various forms, e.g. array, wave-
form, or dynamic data. It plots all the received points at once.
You can visualize more than one data source on a chart or graph. In the following
example DAQ Assistant take data from two channels. You can see data from all
channels on a chart as shown in Figure 12.
A multi-plot chart can be displayed as overlaid plot or stacked plot (Figure 13).
To select Stack Plots or Overlay Plots right-click on the chart. Overlay Plots mode
overlays all plots on the same y-axis. Stack Plots mode gives the each plot its own
y-axis.
To plot y values in a chart/graph you should wire only the y array data (y values)
to the Waveform Chart or Waveform Graph. LabVIEW assumes that you sample y
values at regular intervals, and thus creates x values at regular intervals. If you want

9
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 10.
2D and 3D visualization palettes.

to specify x and y values for a plot, you can use XY Graph. In the following
example we plot multiple circles in a XY Graph (Figure 14).
If you want to display both analog and digital signals together in a graph, use a
Mixed Signal Graph located in the Graph palette. A Mixed Signal Graph is made by
bundling multiple graphable data types. You can add plot area from the pop-up menu
of an existing plot area by selecting Add Plot Area. You can also remove a plot area
by selecting Remove Plot Area. In the following example, you can see both analog
and digital signals together in a Mixed Signal Graph with two plot area (Figure 15).
LabVIEW allows you to use 3D graphs to plot data in three dimensions. 3D
graphs are located in Controls> > Modern> > Graph> > 3D Graph. LabVIEW
allows you eleven types of 3D graphs: The Scatter, Bar, Pie, Stem, Ribbon, Contour,
Quiver, Comet, Surface, Mesh, and Waterfall graphs. You can see some of them in
Figure 16. However, to study with 3D graphs you must have learned basics of
vector and matrix.
Plot Helper.vi is automatically created in the block diagram when you drop any
of the 3D graph. Plot Helper.vi is a polymorphic VI and thus it can accept Matrix or
Vector inputs according to your selection (Figure 17).
You can find the two examples of 3D graphs, below.
In the following example we created a cylinder combining 5 circles whose z axis
points are different from each other. Note that i (iteration number) generates z
matrix (Figure 18).
The following VI generates a sphere and visualizes it in 3D Parametric Graph
(Figure 19). Here radius of sphere is 5 and sphere is generated by 20 circles. A
sphere is a collection of circles. You can see from XY Graph that each circles are
individual size.

3.2 Publishing information to the web

LabVIEW can publish any application to the Web with Remote Panels. There-
fore, you can easily make your VI reachable as a Web page. Thus, clients can control

10
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 11.
Chart and graph.

Figure 12.
Visualization of data acquired from 2 channels of a daqcard.

11
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 13.
Overlay plots (left) and stack plots (right) modes.

Figure 14.
Multiple plots in a XY graph.

the VI or view generated data by using their web browsers. Clients must use a
version of the LabVIEW Run-Time Engine compatible with the version of
LabVIEW. NI recommends that customers use the supported browser (Internet
Explorer). Google Chrome version 42 and later, Mozilla Firefox 52 and later, Safari
12.1 in macOS Mojave 10.14, and Microsoft Edge are not supported browsers.
Before view and control a front panel remotely, the Web Server must be enabled on

12
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 15.
Mixed signal graph with three plots.

the server computer where the VI or application wanted to view and control is
located. Follow the steps below to learn how you can do it.

1. Create a VI. We created a VI named Remote Panel Example.vi (Figure 20).

2. Open block diagram and click to Tools»Options»Web Server

3. Under the Remote Panel Server section, check Enable Remote Panel Server
(Figure 21).

13
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 16.
3D graph examples.

Figure 17.
Plot helper.Vi.

4. Under the Visible VIs section, enter the name of the VI (Remote Panel
Example.vi) in the Visible VI field and press the Add button (Figure 22).

5. Under the Browse Access section, enter the network name of the computer
and press the Add button. Allow viewing and controlling option must be
selected (Figure 22).

6. Click OK and exit out of the Options dialog box.

7. Navigate to Tools»Web Publishing Tool to open the Web Publishing Tool


dialog box.

8. Under Select VI and Viewing Options section, select the VI. After selecting
appropriate Viewing Mode click Next (Figure 23).

9. Fill Document title, Header and Footer sections and click Next (Figure 24).

10. Under the Save the New Web Page section, select where to save the
HTML file and choose the file name and press Save to Disk button
(Figure 25).

14
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 18.
Creating a cylinder in 3D counter.

11.Click Connect button in Document URL window (Figure 26). Ensure that
default browser is Internet Explorer. If not, copy URL address and paste it to
Internet Explorer.

You will see the following Internet Explorer page (Figure 27). In this page,
clients must click Run button to control the VI from their computer.

3.3 Report generation

LabVIEW includes Report Generation toolkit to present your data in a


Microsoft Office Word and/or Excel file. To use LabVIEW Report Generation
Toolkit, it must be installed. Then corresponding functions will be located in
Functions> > Report Generation palette (Figure 28).

3.3.1 Microsoft office word and excel reports

Report Generation palette contains many functions. Therefore, it is not easy to


understand their properties. We recommend that you examine first the report
generation example VIs in LabVIEW (Help>> Find Examples>> Search). You
can modify them according to your purpose. These VIs generally generate reports
based on templates. Using a template, allows you to generate standard reports for

15
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 19.
Drawing a sphere.

Figure 20.
Remote panel example.Vi.

each execution of a VI. In the following example we generate a report for Microsoft
Office Word (Figure 29). The example draws a circle and paste the circle to a Ms.
Office Word document (Figure 30). You can determine color, size, graph type,
marker style etc. by using the functions in Word Specific palette (Figure 31).
Similarly, you can use Excel Specific palette to generate programmatically an Excel
report (Figure 31).
When you execute the VI you see the following picture in an automatically
created Word document.

3.3.2 HTML report

LabVIEW has the ability to programmatically create html reports. Html files can
be read by web browsers. We highly recommend you to present your data as a html

16
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 21.
Options»web server.

Figure 22.
Visible VIs and browser access list.

file. Because reading an html file is not effected by version of web browsers. On the
contrary, current version of Microsoft Office Word or Excel in your computer may
not be compatible with LabVIEW Report Generation toolkit you installed.
The following VI generates an html report (Figure 32). Here, Random Number
function generates Y array. X Array is generated by absolute time values.
When you execute the VI above the following report will be generated
(Figure 33).
Report Generation toolkit also contains Report Express VI and MS Office
Report Express VI (Figure 34). These Express VIs allow you to present data in
form of html, MS Office Word or Excel.

17
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 23.
Select VI and Viewing options.

Figure 24.
Document title, header and footer.

In the following example, we use Report Express VI to present data in html


format (Figures 35 and 36). You can also send data to printer or present data in MS
Office Word or Excel format with the same VI. To do this double click Report
Express VI and select the corresponding line from Destination tab in
Configuration Report window.
When you execute the VI above you will see the following report.

18
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 25.
Save the new web page.

Figure 26.
Document URL window.

3.4 Save data

You can create folder, file or path, write and read data by using the File I/O VIs
and functions (Figure 37). LabVIEW allows you to save data with different data
formats.
Write Delimited Spreadsheet.vi converts a 2D or 1D array to a text string and
writes the string to a new byte stream file or appends the string to an existing file.
Both 2D and 1D arrays can be strings, signed integers, or double-precision numbers.
You should put Write Delimited Spreadsheet.vi out of the loop (Figure 38).
Putting the VI inside the loop is not the good way of using it. Because LabVIEW at
every iteration would open-write-close the file if it is inside the loop. This is not
good in terms of VI efficiency.
You can also write date/time information for each data point. In the following
example (Figure 39), data consist of time and random number.
Read Delimited Spreadsheet.vi reads a specified number of lines or rows from a
numeric text file beginning at a specified character offset and converts the data to a
2D, double-precision array of numbers, strings, or integers. In the following

19
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 27.
Viewing and controlling front panels remotely with internet explorer.

example VI writes and reads data by using Write Delimited Spreadsheet.vi and
Read Delimited Spreadsheet.vi (Figure 40). Note that we formatted time and
random number by using Format Into String.
Another way to write and read data is to use Write To Measurement File and
Read From Measurement File (Figure 41). It can only accept numeric or wave-
form data although Write To Spreadsheet File can accept array of strings, signed
integers, or double-precision numbers. We recommend that you use Write To
Measurement File to write data on disk. Because this Express VI allows you to save
data as text (LVM), binary (TDMS), binary with XML header (TDM) and
Microsoft Excel (.xlsx) formats.
Write To Measurement File is an Express VI. When you double-click to the
Express VI Configure Write To Measurement File window opens (Figure 42).
Here, you can configure writing.
As you see in Figure 42 Configure Write To Measurement File window allows
you to change settings. It may be difficult to understand how you can configure this
Express VI for the first time. To understand the function of each setting, we suggest
that you individually experience with each setting.
In the following example we add time values (x) to the signal (random numbers,
y) by using Write To Measurement File (Figure 43). Time data must be
connected to Comment terminal of Write To Measurement File.
You can also save string data using Write to Text File. In the following exam-
ple, VI saves date with time information (Figure 44).

20
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 28.
Report generation palette.

Figure 29.
Word report example VI.

Similar to examples above you can write and read data by using Write Binary
File and Read Binary File (Figure 45). Binary files use less data storage. Therefore,
it is useful when you have large data. However, Write To Measurement File save
data as binary format, too. You may not need to use Write Binary File and Read
Binary File.

21
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 30.
Circle created by the VI.

Figure 31.
Word specific and excel specific palettes located in report generation palette.

You can write and read waveform data by using the function of Waveform File
I/O in File I/O (Figure 46).
The following VI generates two waveform sinus signals and write-read them
(Figure 47).
NI has created a technical data management (TDM) solution. TDM Streaming
is located in File I/O palette (Figure 48).
NI recommends costumers to use TDMS file format because it combines the
advantages of several data storage options in one file format (Table 1). You can also
work with TDM and TDMS files in Excel by utilizing the free TDM Excel Add-in for
Microsoft Excel (supported Excel version: from 2007 to Excel 2016). You can take
additional information from the following link. [3]

22
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 32.
VI generating an html report.

https://www.ni.com/en-tr/support/documentation/supplemental/06/the-ni-td
ms-file-format.html.

3.5 Interactively manage data

3.5.1 National instruments DIAdem

DIAdem is a software to manage large amounts of data for measurement data


aggregation, inspection, analysis, and reporting (Figure 49). With DIAdem,
extraction of information from data can be efficiently performed. DIAdem is well
adapted to LabVIEW. You can transfer your data from your LabVIEW application
to DIAdem. With DIAdem, DataPlugins can be used to read, inspect and search
different kinds of custom file formats. NI supplies free downloadable DataPlugins
for hundreds of the most commonly used data file formats.

23
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 33.
The html report generated by functions in report generation toolkit.

Figure 34.
Report express VI (left) and MS Office report express VI (right).

24
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 35.
Report express VI and Configuration report window.

25
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 36.
The html report generated by report express VI.

26
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 37.
File I/O palette.

Figure 38.
VI can save data after loop is stopped.

3.5.2 LabVIEW and OriginPro

National Instruments engineers have created various NI LabVIEW add-ons


which contain many functions and subVIs to meet the required functionality.

27
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 39.
Write delimited spreadsheet.Vi and resulted txt file.

Figure 40.
Write and read data by using write delimited spreadsheet.Vi and Read delimited spreadsheet.Vi.

Besides the add-ons developed by NI engineers, add-ons have been developed for
some other applications such as Origin. Origin or OriginPro is a powerful data
analysis and graphics software preferred by scientists and engineers in industry,
academia and research laboratories around the world [4]. Once the data collected by
LabVIEW, the end-user will need to analyze the data and generate reports for
presentation. Origin provides powerful analysis and graphing tools to reanalyze and
present data. The ability to communicate easily between LabVIEW and Origin is a
good platform that can greatly increase its efficiency in terms of data analysis and
presentation [5]. There are studies in the literature using Origin and LabVIEW for

28
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 41.
Write to measurement file and read from measurement file.

Figure 42.
Configure write to measurement file.

this purpose [6]. Origin provides subVIs to make work in LabVIEW environment.
These subVIs allow to data transfer from LabVIEW to Origin and the data to be
analyzed and presented in the Origin environment. This subVIs can be accessed
from the folder where OriginPro is installed (Samples\COM Server and Client
\LabVIEW). Also, in order to quickly access these subVIs in the LabVIEW environ-
ment, the subVIs can be copied from the installed folder and then pasted into a
folder named OriginPro in vi.lip\addons folder where LabVIEW is located [7].
OriginPro library can be accessed from the menu opened by right-clicking on add-
ons in the Block Diagram window in LabVIEW as shown in Figure 50.
After adding the subVIs provided by OriginPro to LabVIEW, you can see subVIs
as shown in Figure 51. There are four sections under Origin function palette.
These are

29
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 43.
Write to measurement file with time information.

Figure 44.
Write to text file and resulted txt file.

30
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 45.
Write to binary file and read from binary file.

Figure 46.
Waveform file I/O.

• OriginApp: Basic VIs that handles the Origin OPJ files, worksheet and columns,

• OriginAppClassics: Older VIs existed before Origin 8 (deprecated),

• OriginWave: VIs that handles Origin matrix objects,

• OriginMatrix: VIs that handles LabVIEW Waveform data.

31
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 47.
Write-read waveforms.

Figure 48.
TDM streaming.

ASCII Binary XML Database TDMS

Exchangeable √ √ √

Small Disk Footprint √ √

Searchable √ √

Inherent Attributes √ √

High-Speed Streaming √ √

NI Platform Supported √ √ √ √ √

Table 1.
Advantages of TDMS file format.

32
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 49.
DIAdem.

Figure 50.
LabVIEW library of OriginPro.

In the following example, the measured temperature values are transferred and
plotted in OriginPro. In this example, first, add OA_ConnectToOrigin.vi to the
Block diagram so that LabVIEW can connect to OriginPro. Once the link between
LabVIEW and OriginPro is established, add OA_NewWorksheet.vi to the
Block diagram to open a new worksheet in OriginPro. This also creates the
name and details of the worksheet to use the entries of VI. After that, you use
OA_GetColumn.vi to select a column. Then, you send the information of this
column via OA_Col-Setting.vi. You will have to pay attention to two important
points while filling in the entries of this VI. The first is the Data Format. This is the
part where you need to write the format of the data. The second is the column type.
Here we can determine the axis of the column to use in the chart. You can specify an
axis such as X, Y, or Z, as in the example shown in Figure 52. After this process is
completed, you will be able to transfer your data to the worksheet by using
OA_Col-SetData.vi. You can use the Read Delimited Spreadsheet.vi in the File
I/O menu to send the data to worksheet created in the Origin environment as in the
example shown in Figure 52. You should pay attention for the correct format of the
data. In addition, if you are working with data consisting of a single data created in
33
LabVIEW - History, Applications, Current Trends and Perspectives

Figure 51.
Palette section.

Figure 52.
Sending data from LabVIEW to OriginPro.

Figure 53.
The output of the OriginPro.

certain periods of time such as the data used in this example, and if you are going to
plot these data versus time, you will need to use OA_Col-SetEvenSampling.vi.
Finally, VI in Figure 52 plots the temperature data at 0.5 ms intervals as shown in
Figure 53 by using OA_NEWEmptGraf.vi and OA_PlotWksCols.vi.
34
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

Figure 54.
Origin template.

Figure 55.
Utilization of origin templates in LabVIEW.

Similarly, another example is to use the template you created in the OriginPro. For
this, you must first create a template in the OriginPro. Save this template in Docu-
ments\OriginLab\2015\User Files folder in your computer. In this case, it will be easy
for you to access this template from LabVIEW. For an example application, a template
has been prepared in OriginPro as in Figure 54. Now add OA_ConnectToOrigin.vi to
the Block Diagram for the connection between Labview and OriginPro.
OA_AddOriginPath.vi creates the file path. Then, use OA_Load.vi to upload file.
OA_FindWorksheet.vi is to select worksheet. After this step is completed, since you
defined Voltage for the X axis and Current for the Y axis in the template, you need to
send your data to OriginPro accordingly. For this, you can use OA_GetColumn.vi to
select column. You can send your data to these columns with the help of OA_Col-
SetData.vi. These steps are given in Figure 55. Here, the data you previously saved in
the LabVIEW environment is opened again and drawn in OriginPro [8].

4. Conclusion

The scientist and engineers frequently need to measure physical changes, ana-
lyze them, and present data from the measurement. LabVIEW includes hundreds of
35
LabVIEW - History, Applications, Current Trends and Perspectives

built-in and add-ons functions for analysis and presentation of data. If you do not
know LabVIEW well, you should check the examples in LabVIEW and ni.com. This
is the easiest way to learn how you can analyze and present your data.
LabVIEW has effective 2D (Charts and Graphs) and 3D visualization tools for
data presentation. Graphs accept only array data. It plots all the received points at
once. Charts attach received data to already existing points. When an array of
points is wired to a chart or graph, LabVIEW assumes the points are equally spaced
out. If you also want to define X axis values, you should use XY Graph.
LabVIEW allows you to present your data html, Microsoft Office Word or Excel.
LabVIEW also allows you to publish any application to the Web with Remote
Panels. Therefore, your VIs can be reachable as a Web page. You can control a
remote device from your home. It is interesting, right?
Generally, you want to save and read your data. There are different ways to do it
in LabVIEW. We recommend you to use Write To Measurement File and Read
From Measurement File. These supports data as text (LVM), binary (TDMS),
binary with XML header (TDM) and Microsoft Excel (.xlsx) formats.
DIAdem software is a NI product to manage data for measurement data aggre-
gation, inspection, analysis, and reporting. Interestingly, DIAdem can use more
than one thousand data file formats by utilizing DataPlugins.
More than 500,000 clients in the world use OriginPro to import, graph, explore,
analyze interpret their data. If you are a user of OriginPro software, you can
integrate it with LabVIEW. When you install Origin add-ons for LabVIEW you can
easily communicate with OriginPro.

Thanks

We thank to Serdar Bölükbaşıoğlu, manager of Ludre Software company, for


his contribution.

Author details

Ahmet Mavi1, Ahmet Özmen2 and Mehmet Ertuğrul3*

1 Department of Nanoscience and Nanoengineering, Atatürk University, Institute


of Science, Erzurum, Turkey

2 Department of Electronics and Automation, Vocational School, Agri Ibrahim


Cecen University, Ağrı, Turkey

3 Department of Electric and Electronic Engineering, Faculty of Engineering,


Atatürk University, Erzurum, Turkey

*Address all correspondence to: [email protected]

© 2021 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms
of the Creative Commons Attribution License (http://creativecommons.org/licenses/
by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,
provided the original work is properly cited.

36
Analyzing and Presenting Data with LabVIEW
DOI: http://dx.doi.org/10.5772/intechopen.96130

References

[1] Analysis Concepts [Internet]. 2004.


Available from: https://www.ni.com/
pdf/manuals/370192c.pdf [Accessed:
2020-12-27]

[2] Mavi A, Ertuğrul M. LabVIEW


Uygulamaları 1 (in Turkish). 1th ed.
Ertual Akademi; 2016 308 p. ISBN:978–
605–83722-4-5

[3] The NI TDMS File Format [Internet].


2020. Available from: https://www.ni.c
om/en-tr/support/documentation/
supplemental/06/the-ni-tdms-file-f
ormat.html.html [Accessed: 2020-12-27]

[4] Origin and OriginPro [Internet].


2021. Available from: https://www.orig
inlab.com/Origin [Accessed: 2021-01-
18]

[5] Use of National Instrument


LabVIEW as a client application
[Internet]. 2021. Available from: https://
www.originlab.com/doc/Origin-Help /
LabVIEW-client-app [Accessed:
2021-01-18]

[6] Weiskirchen R, Weiskirchen S, Kim


P and Winkler R. Software solutions for
evaluation and visualization of laser
ablation inductively coupled plasma
mass spectrometry imaging (LA-ICP-
MSI) data: a short overview. Journal of
Cheminformatics. 2019;11:16. DOI:
10.1186/s13321-019-0338-7

[7] Using Origin from LabVIEW


[Internet]. 2016. Available from: www.
originlab.com/pdfs/Origin2017_Doc
umentation/English/Using_Origin_f
rom_LabVIEW_E.pdf [Accessed:
2021-01-18]

[8] Özmen A, Coşkun A, Ertuğrul M.


Measurement and Analysis with
LabVIEW Software. In: Academic
Studies in Engineering. HAYALOĞLU
ADNAN; GÜNDAY ABDURRAHMAN;
2020. p. 95–106.

37

You might also like