Example Code

Programmatically Import All Virtual Devices & IVI Configurations for NI Switch Executive

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.

    Hardware

  • Modular Instrumentation

    Software

  • LabVIEW
  • Other

Code and Documents

Attachment

Overview

The provided code allows for programmatic import of all Virtual Devices and IVI Configurations exported from one installation of NI Switch Executive (NISE) to another.

  

Description

This VI will Import NISE XMLs from a selected folder into the MAX database. Additionally, this VI will import the IVI configuration store. This is beneficial for large system deployments, as Virtual Devices and IVI configuration would not have to be manually recreated.

 

The example performs the following tasks:

 

  1. Based on the operating system, the location for the IVI configuration store file is selected.
  2. Creating file paths for the old IVI Configuration Store, and the new one.
  3. Copying the old IVI Configuration Store and renaming it "*_old.xml"
  4. Copying the new IVI Configuration store from the selected folder into the correct  directory
  5. Gets all the filenames from the NI Switch Executive XML Import Folder.
  6. Build the path for import based on the files listed in the folder.
  7. Gets the Device name from the xml filename.
  8. Imports the XML file to the MAX database, overwriting IVI device names as necessary.

 

Requirements

Software

  1. NI LabVIEW 2012 (or compatible) 
  2. NI Switch Executive compatible with the version of LabVIEW
  3. XML Configuration File

 

Steps to Implement and Execute Code

  1. Open as a standalone VI; or place as SubVI, or LabVIEW step in a TestStand sequence
  2. Select the import location in the "NI Switch Executive XML Import Folder" control
  3. Select Whether you want to import the IVI configuration by checking or unchecking the "Import IVI?" boolean
  4. Select your operating system in "Operating System"
  5. Select the folder containing your "IviConfigurationStore.xml" file under the "IVI XML Import Folder" control
  6. Run VI / Step

 

 Additional Information or References

 VI Snippet
11111.png

 

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

 

Frank,
National Instruments
Software Group Manager

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