Example Code

XControl to register caller VI ref when run starts

Code and Documents

Attachment

Overview
This example creates a debugger that has ALL the VI references by obtaining the This VI Reference and registering it with a central system as soon as execution begins.

 
Description
You can put this XControl on the front panel of a VI that you want to register with your debugger and you put the code shown on the block diagram of Reentrant.vi on the diagram of whatever VI you want your debugger to be capable of monitoring. This specific pattern of code forces the panel into memory, without opening it, which gives the XControl a unique panel existence. You can also put the same code on a reentrant VI or a non-reentrant VI, so there's no worry about changing types.

 
Requirements

  • LabVIEW 2013 (or compatible)

Steps to Implement or Execute Code

  1. Write a custom debugger that needs a list of VI refnums from various running VIs but cannot get them because there's no (good / safe / reliable) way in LabVIEW for external VIs to get references to clone VIs.
  2. Put the XControl and the code shown on the diagram of Reentrant.vi into the VIs that you want to track.
  3. Use the Global Registry.vi in your debugger to get all the refnums.

 

Additional Information or References
VI Block Diagram

1.png

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

 

 

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

Comments
tst
Knight of NI Knight of NI
Knight of NI
on

ceci n'est pas un chaton?


___________________
Try to take over the world!