How Do I Open a File Using LabVIEW?

Updated Jan 11, 2018

Reported In

Software

  • LabVIEW Base
  • LabVIEW Full
  • LabVIEW Professional

Issue Details

I want to open a file using Windows command line in LabVIEW. How can I accomplish this?

Solution

To open a file using the Windows command line, you will need to use the System Exec VI that can be found in the  Connectivity » Libraries & Executables palette.

The follow VI Snippet illustrates how to use the System Exec VI to open a file on your system.

  • As indicated by the label, you will need to change "test.docx" on the string constant to the name of the file you are trying to open.
  • Also, you will need to change the directory to the location that the file is stored on your system.

 

Additional Information

  • The syntax displayed will close the Command Prompt window after you close the file that you opened. If you would like to leave the Command Prompt window open, you can replace /c with /k.
  • Leaving the constant as false will allow your VI to complete while your document is still open. If you would like the VI to continue running while the document is open, you can change the constant to true.

WAS THIS ARTICLE HELPFUL?

Not Helpful