Example Code

Select Multiple Files With Native LabVIEW Dialog Box

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 how to display a customized file selection dialog box allowing the user to select mutiple files.

 

Description

It seems to be the general agreement that the only way to select multiple files in a file selection dialog box is through external calls, such as .NET, ActiveX, C# dll, etc. However, this can be easily implemented in LabVIEW. The example calls a subVI which is called File Dialog and is not available in the function palette.

It is the low level VI that is called by File Dialog Express VI, so you can just place that express VI in your block diagram, right-click the express VI icon and select "Open front panel", and then use its block diagram.

You can also browse to C:\Program Files\National Instruments\LabVIEW xx\vi.lib\express\express input\FileDialogBlock.llb to find it named subFile Dialog.vi or you can just use this example.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI
  2. Select multiple files browsing to any folder, by clicking Ctrl key
  3. Click Thanks LabVIEW!! button to close the dialog box and stop the VI
  4. Notice that if you click Cancel button in the file selection dialog box, error code 43 is returned. You can add code to delete that error, or you can connect the error wire to a case structure to determine what needs to be done in case the user cancels.

 

Additional Information or References

VI Block Diagram

 

 Select Multiple Files LV 2012 NI Verified.png

 

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

Chris Van Horn
Applications Engineer

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

Comments
Sean-user
Member
Member
on

That is an unusual VI. Nice find! I don't know if I would use such a VI on a product or anything beyond 'play' code.

DCanQAlias
Member
Member
on

In LabVIEW 2011, this vi is no longer supported by NI.

You can edit the File Dialog express VI, though, and uncheck the option "Limit Selection to single item". Same result.

Mike.V
Member
Member
on

This code worked for me in LabVIEW 2011.  Thanks

GleMunyan
Member
Member
on

This was EXACTLY what I needed for an offline analysis VI to plot multiple files.  Thank You.

LeMur Technology Services, LLC
busko
Member
Member
on

WOW!!! It is right what I need!! Thanks a lot. I use LV2012, and it still works.
No it is so easy to combine data from different measurements in one.

Really -- many many many thanks!

RainbowShadow
Member
Member
on

Just what I needed, LV2014

cpip
Member
Member
on

Beautiful. This works even with LV2015 sp1.