Example Code

LabVIEW Sound Board Using Windows Text to Speech Converter (Daft Punk)

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 is an example of how to save the value of enum controls on the front panel to a .xml file and subsequently restoring them.


Description
This example shows how to save enum controls to an xml file and then reads the same xml file to restore the data. There are two VIs: Saving and Restoring.

The Saving VI first gets the name and value of the enum control using property nodes and then saves them as two values in a cluster. This cluster is then converted into xml format and written to a text file for readability.

The Restore VI then reads the xml file and converts it back into a cluster of two elements. We then read the two elements to restore the data into the enum.

 

 

Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

 

  1. Download the appropriate .zip files for your installation of LabVIEW
  2. Run the Saving Enum to XML (LabVIEW 20xx).vi first and follow the instructions on the front panel
  3. Run the Restoring XML to Enum (LabVIEW 20xx).vi second and follow the instructions on the front panel

 

Additional Information or References
VI Block Diagram

 1.png

 2.png

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

 

 

Ian S
Applications Engineer CLA
National Instruments UK&Ireland

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

Comments
MHutch
NI Employee (retired)
on

This gets my approval. Because Daft Punk!

Matt H
Applications Engineer
National Instruments UK