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.
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?
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.