Example Code

Open Project VI Reference : How to Obtain a VI Reference without Specifying a Path

Code and Documents

Attachment

Overview
This example VI shows you a method to get a VI reference which is contained in the same project as you calling this example VI.

 


Description
This example VI shows you a method to get a VI reference which is contained in the same project as you calling this example VI. The principle of the VI is to parse the parent project of the calling VI, searching for the VI you specified. If not found, the VI reference is “Not a Refnum Constant”. Otherwise, the VI returns the matching VI reference. The VI Name input is not case sensitive.

It can be very handy when it comes to RT project, where the VI server can be used to run several RT VIs, but where the path issue can be disturbing.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the VI "Open Project VI Reference 2012 NIVerified.vi"
  3. Run the program

 

Additional Information or References
VI Snippet

Block Diagram.PNG 

 

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

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

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