Example Code

Create Multiple Files With Incrementing Suffix In The File Name

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 code demonstrates how to create multiple (measurement) files with an incrementing suffix in the file name.

 

Description

It is sometimes necessary to split a large file into multiple files with an incrementing suffix in the file name. LabVIEW 2015 (or compatible) provides a built in VI called "Create File with Incrementing Suffix" which can be used for this purpose. If you use LabVIEW 2014 or previous, you have to implement this functionality by yourself. This example shows a way to create a file with an incrementing suffix if you can't take advantage of LabVIEW 2015 (or compatible). It is not the same implementation like the sipped "Create File with Incrementing Suffix" VI.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • If running in a Real-Time context, you will need the LabVIEW Real-Time Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

 Steps to Implement or Execute Code

  1. Download and open the attached VI
  2. Set the Folder Path and change the File Name and File Extension if needed.
  3. Run the program

 

Additional Information or References

Create Multiple Files With Incrementing File Name - Front Panel.png

 

Create Multiple Files With Incrementing File Name - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner

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

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting.  Could you include a screenshot of the code to give us an idea of what it does?

Todd S.
LabVIEW Community Manager
National Instruments
Jon_S.
Active Participant
Active Participant
on

The picture was too large to put on the page without severly blurring the image.  The .bmp file is attached for users to look at.

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
jaydee1
Member
Member
on

This vi will not open in labview 8.5, which is what i have. Can you make it compatible with that version please? I'm not yet ready to convert my code to 8.6 as i've been working on it for a while now. Thanks.

Jon_S.
Active Participant
Active Participant
on

Posted

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
elset191
Active Participant
Active Participant
on

There's a better way to do this.  Using the File/Directory Info icon, you can see how many files are in the directory.  Then just increment this and append it to the file path.  This way, as you get more files, you're not running through a for loop 100 times every time you want to save.

--
Tim Elsey
Certified LabVIEW Architect