Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Using VIs and Functions for Common File I/O Operations

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

The File I/O palette includes VIs and functions designed for common file I/O operations, such as writing to or reading from the following types of data:

  • Numeric values to or from spreadsheet text files
  • Characters to or from text files
  • Lines from text files
  • Data to or from binary files

You also can configure read and write functions, such as the Read from Text File and Write to Text File functions, to perform common file I/O operations. These VIs and functions for common operations can open the file or prompt you to do so in a dialog box, perform the read or write operation, then close the file to save you time and programming effort. Avoid placing the File I/O VIs and functions configured to perform multiple operations in loops because the VIs and functions perform open and close operations each time they run. Configure the functions to keep files open while you perform multiple operations.

The following block diagram shows how to use the Write To Spreadsheet File VI to send numbers to a tab-delimited spreadsheet file. When you run this VI, LabVIEW prompts you to write the data to an existing file or to create a new file.

The open, read, and write functions expect a file path input. If you do not wire a file path, a dialog box appears for you to specify a file to read from or write to.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit