Example Code

Programmatically Get VI/Clone Names in LabVIEW

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

Download All

1. Overview:

This Example shows how to programatically get the Name or Clone Name of a VI. If the VI is run as top level VI, the name of the VI will appear. If the VI is used as subVI in a main VI, it will return the name of the clone.


2. Description:  

Sometimes is needed to get the name of a VI. In this example is implemented a way of getting the name of a VI both if it is a clone or not. To implement this, calls to the VI Server are used.
The example includes a VI called "Clone Name Finder" that calls 4 clones of the "Get Clone Name LabVIEW 2012 NI Verified.vi". In this case, the names of the 4 clones are shown in the front panel.
If "Get Clone Name LabVIEW 2012 NI Verified.vi" is run, the name of the VI will be shown in its front panel.

   

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Extract the files from "Get Clone Name LabVIEW 2012 NI Verified.zip"
  2. Run "Get Clone Name LabVIEW 2012 NI Verified.vi". As is run from itself, it will return its own name 
  3. Run "Clone_Name_Finder.vi". This VI launches four clones and shows the names of each of them. Each clone will show its own name.

5. Additional Information or References

 VI Block Diagram

 Snippet.png

 

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

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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