Example Code

Exporting/Importing User Channel Default Values using VeriStand .NET APIs

Code and Documents

Attachment

Overview

There are many instances when NI VeriStand users would like to transfer the configuration from one system definition file to another or between deployments. One such instance is with User Channels. These examples demonstrate how to use the NI VeriStand .NET System Definition API to export the User Channel Default Values to a text file and import these values from a text file.

Steps to Implement

Exporting User Channel Default Values to Text File

After exporting, the user will have a tab-delimited text file with the User Channel path and Default Value.

  1. Open the Export User Channel Default Values.vi.
  2. Set the System Definition File to the system definition file with which to export User Channel Default Values from.
  3. Set the User Channel Default Values Text File to the location of the text file to save the User Channel Default Values to.
  4. Run the VI.
  5. The User Channels Saved Listbox will display the User Channels which were found and saved to the text file.

2014-04-30_1118.png

Importing User Channel Default Values from Text File

Using a tab-delimited text file with the User Channel path and Default Value, the user is able to update the existing Default Values in the system definition to the values present in the file.

  1. Open the Import User Channel Default Values.vi.
  2. Set the System Definition File to the system definition file which will be updated with the User Channel Default Values from the text file.
  3. Set the User Channel Default Values Text File to the location of the text file which contains the User Channel Default Values.
  4. Run the VI.
  5. The User Channels Updated Listbox will display the User Channels which were updated in the system definition file.
  6. The User Channels Not Present in the System Definition File Listbox will display the User Channels not found in the system definition file and therefore not updated.

2014-04-30_1122.png

Requirements

These examples were developed in LabVIEW 2012 for VeriStand 2012. Users in newer versions of LabVIEW will be required to upgrade the VI and relink the .NET library to their version of VeriStand.

National Instruments
Senior Systems Engineer

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

Contributors