Example Code

Programmatically Delete All Virtual Devices in 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 

This VI will delete all NI Switch Executive (NISE) Virtual Devices from the MAX database and can be used as a SubVI or LabVIEW step in a TestStand sequence.


Description
Utilizing the niseCFG Get Virtual Devices.vi and niseCFG Remove Virtual Devices.vi all existing virtual NI Switch Executive devices are programmatically removed. After finding all of the virtual devices, a property node is used pass the name of the devices to the niseCFG Remove Virtual Devices.vi so it can identify which devices to remove. Finally, the NI Switch Executive configuration is saved by wiring a true constant to the Save Configuration input of the niseCFG Close Configuration.vi.

  1. Open NISE Configuration.
  2. Grab the list of virtual device objects.
  3. Verifies that there are virtual devices in the NISE configuration.
  4. Grab the virtual device name from the virtual device object.
  5. Close out the virtual device reference.
  6. Delete the virtual device.
  7. Close and save the NISE configuration.

 

Requirements

Software

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


Steps to Implement or Execute Code

  1. Open as a standalone VI, place as SubVI, or as a LabVIEW step in a TestStand sequence
  2. Run VI/Step

 

Additional Information or References
VI Snippet

 1111.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.