From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Write and Read from Spreadsheet File without the Report Generation toolkit

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI will export a waveform to an Excel spreadsheet.  The waveform data will be able to be viewed in both Excel and LabVIEW.

 

Description

There are three different methods to export from LabVIEW to Excel:

  1. Write to Spreadsheet File
  2. Write Waveforms to File
  3. Export Waveforms to Spreadsheet File

 

This VI allows you to select between these three different methods in the Choose the VI pairs to use control.  It will generate an Excel file called Spreadsheet.xls in the directory that this VI is stored.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

To make this example work with your code, or as a standalone application:

 

  1. Download the attached the VI
  2. Select the method of exporting data from LabVIEW to Excel
  3. Run the VI

 

Additional Information or References

 

Block Diagram

block diagram.png

 

 

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Regards,

Sara Lewandroski
Applications Engineer | National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
iRober
Member
Member
on

Thank you very much, Sara, for this example. It really helped me a lot in understanding how to read and write to an Excel file.

It is also a bonus that your VI works in any OS and platform (it only uses LabVIEW's VIs, and does not use DirectX or things like that) and is really easy to understand and use (all you have to do is open the VI and execute it, you do not have to take any extra steps, such as copying it to a specific folder).

Once again, thank you.

michifez
Member
Member
on

The beauty of this implementation is the endeavour to avoid of delay inherent high level VIs. Thanks for the effort.

Ifeanyi
lahsiv
Member
Member
on

Thanks a lot !

Henok
Member
Member
on

Hi,

I have one request (probably not the right place to post this question).

I have the scenario where I have measurment data for multiple channels ( I have 8 in my case). The data from the channels is interleaved and sent to Enqueue element (so I have a queue of interleaved array). And I want to write this data to binary file on disk. How would I let the Write To Binary primitive about the channel information and how the data is interleaved and such informations? I have implemented this in TDMS and that is why I have these particular questions of channel information settings. Perhaps there is another way of doing this in Binary form.

Appreciate the help.