Example Code

Initializing a Control from a Text File

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview
This example reads a value from a text file and initializes a numeric control to that value.


Description
This VI reads in a value from a text file and updates a numeric control on the front panel using a property node. It then generates a random sample number and writes it to the same file. The next time the program is run, the numeric control gets updated to the last value written in the text file.

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Unzip “Initialize From File 2012 NIVerified.zip”
  2. Open " Initialize From File 2012 NIVerified.vi"
  3. Run the program.

 

Additional Information or References
VI Block Diagram

 5-74.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

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