Example Code

Programmatically Export 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 export of all Virtual Devices and IVI Configurations from one installation of NI Switch Executive (NISE), to be used in another.

 
Description 

This VI will Export NI Switch Executive (NISE) XMLs from the MAX database to a selected folder. Additionally, this VI will export the IVI configuration store. This is beneficial for large system deployments.

This example will perform the following steps in the block diagram:

  1.  Create an "Export" folder at the location specified in the "Export Location" control.
  2. Create an "IVI Exports" folder within the location specified in the "Export Location" control.
  3. Finds the IVI configurations store location depending on the operating system type.
  4. Copies the "IviConfigurationStore.xml" file into the "IVI Exports" folder within the location specified in the "Export Location" control.
  5. Create an "NISE Exports" folder within the location specified in the "Export Location" control.
  6. Opens the NISE configuration from the MAX database.
  7. Grab the list of virtual device objects.
  8. Verifies that there are virtual devices in the NISE configuration.
  9. Grab the virtual device name from the virtual device object.
  10. Export the virtual device as an XML.
  11. Close out the virtual device reference.

 

Requirements

Software

    1. LabVIEW 2012 (or compatible)
    2. NI Switch Executive

Hardware

    1. Any switching hardware compatible with Switch Executive. Refer to the NI Switches Getting Started Guide and NI Switches Help for information about connecting signals to your switch module.


Steps to Implement or Execute Code

  1. Place this VI as a SubVI in line with your NI Switch Executive code
  2. Wire your NI Switch Executive Session Reference, NI Switch Executive Virtual Device Name, and Error wires into the "NISE Find Active Routes.vi"
  3. Create an Indicator at the output of this VI to read the Active Routes
  4. Run the VI

 

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.