Selecting a File Programmatically for Reading and Writing

Complete the following steps to select a file programmatically for reading and writing.

  1. Select the Open/Create/Replace File VI on the Functions»File I/O palette and place it on the block diagram. Alternatively, you can select the New File or Open File function on the Functions»File I/O»Advanced File Functions palette and place it on the block diagram. Refer to Chapter 13, File I/O, of the LabVIEW User Manual for more information about using high-level and low-level or advanced file I/O VIs and functions.
  2. Right-click the file path input terminal and select Create»Constant from the shortcut menu.
  3. Use the Labeling tool to enter the complete path to your file in the path constant. Use the syntax appropriate for your operating system.
  4. Wire the refnum indicator to the next File I/O function.