07-11-2021 06:43 PM
I am having trouble getting a static VI reference to be 'found' in an executable.
I have a class that is part of a library of tools that I want to be able to include in executables.
Within this class is a reentrant private VI that is launched by a 'constructor' of sorts - everything is by reference under the hood. I have multiple running instances of a process that are unique to each instance of the class.
When I specifically include that private subVI in the build everything is hunky dory. However, I don't want to have to do that since I need others to be able to make builds without tracking down this subVI. So... I thought using the static reference on the "constructor" should make it always be included.
Everything is great in the dev environment. It builds without issue and there is no broken run arrow. However when I run it I get error 1003 (cannot locate subVI). Using the debugger shows the static reference is a big ol' question mark.
Is this a problem with using a static reference to a reentrant VI? I've tried opening a clone by path AND by name, but the problem exists upstream from there anyway - the VI reference itself isn't valid.
Is it even possible to get this in the build without including it specifically? aNy help appreciated!
Build settings:
Unchecked both remove FP & BD,
Unchecked remove unused library members
LabVIEW 2020 SP1
Windows 10
07-11-2021 06:53 PM
It is much easier to inspect/debug code rather than a picture!
I'm not sure if I've encountered the situation you describe, but I've not had trouble with Executables with Static VI References. However, I think I usually (always?) used a Strictly-Typed Static VI Reference (which you haven't done). Not sure if this is your problem ...
Bob Schor
07-11-2021 09:51 PM
I tried both, strictly typed and what is pictured here (as well as many other things).
I attached the library here.
There is an example folder and a VI called "Multiple Sequence Example". It runs 2 instances of the sequencer side-by-side. That's the one I've been trying to build - a simple executable to get the method down.
07-11-2021 11:58 PM - edited 07-12-2021 12:00 AM
Oh brother, this was the weirdest and most frustrating LabVIEW hiccup I've had in a very long time. 2 days down the drain.
There was nothing wrong with the code or build spec; "Sequencer Engine.vi" had some sort of weird corruption. LV wouldn't let me place it on the BD of any other subVI. When I created a copy of it and placed that, LV 'thought' it was an Express VI (it isn't). But it all still ran in dev mode anyway. 😖
After I replaced the offender with a newly created subVI , its static ref is found in the EXE and everything runs as it should.
Thanks for taking a look!
07-12-2021 05:20 AM
On a side note, AFAIK (haven't tested it recently) statically referenced VIs are included automatically in builds, but statically referenced VIs in those VIs aren't.