**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

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

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

When you execute the VI above you will see the following report.

**Configuration Report** window.

*Document title, header and footer.*

**Figure 23.**

**Figure 24.**

**20**

*Select VI and Viewing options.*

#### **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 waveform 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.**

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**.

**23**

**Figure 29.**

*Word report example VI.*

**Figure 28.**

*Report generation palette.*

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

You can also save string data using **Write to Text File**. In the following example, VI saves date with time information (**Figure 44**).

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

## **Figure 28.**

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

data as text (LVM), binary (TDMS), binary with XML header (TDM) and

y) by using **Write To Measurement File** (**Figure 43**). Time data must be

connected to **Comment** terminal of **Write To Measurement File.**

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 waveform 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

**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**).

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

In the following example we add time values (x) to the signal (random numbers,

You can also save string data using **Write to Text File**. In the following exam-

random number by using **Format Into String**.

*Viewing and controlling front panels remotely with internet explorer.*

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

that you individually experience with each setting.

ple, VI saves date with time information (**Figure 44**).

Microsoft Excel (.xlsx) formats.

**Figure 27.**

**22**

Here, you can configure writing.

*Report generation palette.*

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**.

**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**).

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

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.

ms-file-format.html.

*VI generating an html report.*

**Figure 32.**

**25**

**3.5 Interactively manage data**

*3.5.1 National instruments DIAdem*

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

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].
