Example Code

Writing Data to a File Using LabVIEW

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 example shows two possible methods for writing data to a file to save/log/view later. These two methods include the "Write to Measurement File" Express VI and the "Write to Spreadsheet File.vi" function block.

 
Description
This VI creates a user defined amount of random data in the form of random numbers. It then takes the data gathered and writes this data to a file. The format of the file can be specified in the Express VI. The format of the function block can be opened in different programs (such as notepad, Excel, word, etc.)

 
Requirements

  • LabVIEW 2013 (or compatible)


Steps to Implement or Execute Code

  1. Set File location and name of file on the VI's front panel by clicking on the folder icon.
  2. Run VI
  3. Open desired file

 

Additional Information or References
VI Block Diagram

 1.png

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

 

 

Rob W.

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

Comments
okmanto
Member
Member
on

Hi guys,

is there any one who is able to help me? my problem is actually very simple but i cannot figure out it.

My labview always writes data in every 1 ms, but i need the labview to write the data at every 30 minutes, could you show me how to make a program for this?

my samples are continues samples, 1k samples, 1k hzs

many thanks