Showing results for 
Search instead for 
Did you mean: 

Get references to static VI refs, pre-build action

Labview will refuse to build an executable if any source VIs are broken, but a VI which calls another VI using a static reference, which itself is broken, will still be built. And if compiling a library instead of an executable, source VIs are not checked to be "good". Thus, I've written a pre-build action to check that VIs are not broken (or "bad").


The trouble is that I have no way to get a list of *only* the static VI refs of the source VI hierarchy. Using the VI dependencies method, which will return statically referenced VIs, you can only get the static VIs when BOTH "whole heirarchy" and "Static VI Refs" are true. If you select Static VI Refs and set Whole Hierarchy to false, you get no static refs returned by this method. This seems incorrect. it also increases dramatically the time required to verify the build VIs are all working.

static vi refs.PNG

I *could* specifically include all static VIs in the source file list, but this is a bookkeeping task I'd rather not face. 


Is there a way to get a list of just the static VI refs called in a VI's hierarchy?

Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 2

Following up, I had the realization that I could get the entire list with and without the static VIs, and filter the lists to return just the static VIs. What I discovered was that this method returns not just he statically referenced VIs, but also all of its dependencies. Not what was wanted, exactly.


What's weird is that you must have "Include Standard VIs"=T in order to return anything. But I thought standard VIs were ones that were part of LabVIEW, and that my own VIs were not "standard". 


My final solution was to get the filtered list of static VIs, filter out the ones with "/National Instruments/" in their path, and then check if these are broken. For my main application, this adds about 13s to the build time, and for my smaller plug-ins it takes about 1s. Totally worth it.


I have attached a function which can be used as part of a pre-build action by wiring up the source files array. The ouput error will halt the build process.


Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 2 of 2