Example Code

Save Front Panel Control or Indicator Values to Spreadsheet 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

Overview

This examples shows how to save the values of the front panel controls or indicators to a readable text file.

 

Description

This example makes use of "Control Value>>Get All" Invoke Node to retrieve the values of all front panels controls and indicators. 

The "Controls" boolean input of this Invoke Node selects whether the node returns the control or indicator values from the front panel.  The Invoke Node returns an array of clusters representing each controls/indicators.  The cluster contains a string with the name of the control/indicator and a variant containing the value.  This example converts the variant data value to a string to be saved to the text file.

  

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Open the attached VI
  2. Set the front panel switch to select whether to save the controls or the indicators values to the text file
  3. Run the VI
  4. When prompted, select file path and name for the generated text file

 

Additional Information or References

VI Block DiagramSave Front Panel Values to Text File LV 2012 NI Verified.png

 

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

 

Barron
Applications Engineering
National Instruments

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