LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to debug shortcut menu plugin?

I'm on my first attempt to make my own shortcut menu plugin.  I started from "Create Shortcut Menu Plug-In From Template.vi" in <Program Files (x86)\National Instruments\LabVIEW 2018\resource\plugins\PopupMenus>

 

On the block diagram of the  "Execute <plugin_name>.vi" , there's this comment: 

You may enable debugging on this VI to help develop your code. Debugging only has to be disabled on the builder VI, not the execute VI.

 

What does this allow me to do?  If I turn on debugging, then utilize the plugin, it doesn't seem to call the source VI in a way that I can debug it.  i.e. probes and execution highlighting do nothing.  It acts similarly to probing the source of a re-entrant VI rather than the clone.  Running the plugin VI on it's own has no debugging value since there's no reference object on which to act.  

 

What am I missing?

0 Kudos
Message 1 of 3
(2,085 Views)

In the execute VI you could place a break point in the code, save it, and then test the popup menu. This will pop up the block diagram of the code and let you do some debugging. Unfortunately, this is not possible with the utility VI that builds the menu items.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 2 of 3
(2,123 Views)

I use poor man's debugging: one\two button dialog, simple error handler. Not as convenient as 'real' debugging, but still helpful.

 


@David_Hendrix wrote:

Running the plugin VI on it's own has no debugging value since there's no reference object on which to act. 


It also helps me to develop the majority of the scripting in a normal VI. Then when it's finished, copy it to the plugin.

 

Without too much effort, you can make a normal VI that calls the Execute...vi, with references you get from a DUT.vi. A simple traverse for the object, or a get selection method to get the reference, and then call the execute...vi will make it behave a lot like the real thing.

 

You'll have to make wrap the call in begin\end undo methods if you want that (you probably do). This 'test bench' is easy to reuse though. Once you made it, it will be easy to adjust for your next shortcut menu plugin.

0 Kudos
Message 3 of 3
(2,113 Views)