Example Code

Programmatically Save Data with Date and Time as the Filename 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

Download All

Overview

This example demonstrates a method for manipulating the Date/Time string for use as a filename.

 

Description

The Date/Time string inherently contains characters that are invalid for file path building. By searching the string for invalid characters, and replacing each character with an accepted value, such as an '_', users may save their data sets with files names corresponding to the date and time of the trial.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible) 

 

Steps to Implement or Execute Code

1. Run VI.
2. Observe that you logged your data at the address of your VI as "File Name" indicator value.

 

Additional Information or References

 

2012.png

 

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

 

 

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

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

Comments
koman
Member
Member
on

very useful VI to store data periodically.