Example Code

Replace All Instances of SubVI

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 VI will replace all instances of SubVI Name contained within VI Path with Replacement SubVI Path.
Description
This example can be used to replace a certain VI with a different VI throughout an entire application. This could allow for quick modifications or troubleshooting without modifying the original subVI.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Browse to the path of the calling VI with the VI Path control, (Replace_Test.vi).
  2. Enter the name of the subVI you want to replace using the SubVI Name control (test_add.vi).
  3. Browse to the VI with which you want to replace the VI specified in the SubVI Name control (test_sub.vi).
  4. Hit Run, and all instances of test_add.vi contained within Replace_Test.vi will be replace with test_sub.vi.

 

Additional Information or References
VI Block Diagram

 code.png

 

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

David S.

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