Example Code

Drag and Drop a File to Read in LabVIEW

Code and Documents

Attachment

Download All

Overview:
This VI shows how to display the contents of a Text file by drag and drop the file on the control path.

Description:
This example makes usage of the event structure to detect the value change and execute the open and read of the file.

Requirements:
LabVIEW Base Development System 2012 (or compatible)

Steps to Implement or Execute Code:
1. Create/Find a .txt file (Using Notepad or Wordpad)
2. Ensure the file has some content within it
3. Run the DragDrop.vi
4. Drag the file from the Windows environment to the Path control, the contents will appear in the String Indicator.



Additional Information or References:
Drag Drop-NI Verified LV 2012.PNG
**This document has been updated to meet the current required format for the NI Code Exchange.**

Applications Engineer

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