Writing to Text Files

Complete the following steps to write to a text file.

  1. Select a string control on the Controls»String & Path palette and place it on the front panel.
  2. Select the Write Characters To File VI on the Functions»File I/O palette and place it on the block diagram.
  3. Right-click the file path input of the Write Characters To File VI and select Create»Constant from the shortcut menu. An empty path constant appears.
  4. Enter the path of the text file you want to write to in the file path constant.
  5. Wire the string control to the character string input of the Write Characters To File VI.
  6. Run the VI. The VI writes the text from file wired to the file path input and displays the text in the front panel string control.
  7. After you write to a text file, read the file.

Refer to the Write to Text File VI in the examples\files\smplfile.llb for an example of writing a text spreadsheet of simulated acquired data to a file.