06-26-2017 12:40 AM - edited 06-26-2017 12:42 AM
Hi Blokk,
Thanks for the feedback.
Moment of honesty/transparent vulnerability: I've been using LabVIEW since 1993 and I've never understood state machines or why they're needed. My brain doesn't seem to think that way, and I consider myself a reasonably smart and adaptive person. Nor have I ever grasped how and why to run the error wires through my code.
I've been writing VIs for decades and some are very complex. Fortunately, none are ever significantly time sensitive (never more an a few millisec per iteration) so I've never been forced to deal with code time / memory inefficiency.
That said, the code as I've presented it runs sufficiently well for the purpose it serves and operates on both PCs and Macs, for which it is intended. And what I uploaded is not even the bulk of the code. I deleted all subsequent frames and truncated the code, because they did not pertain to the issue at hand and they call a lot of subVIs, which I didn't want to upload because they call additional data files.
That is not to say that I don't want to improve it. So I will take a look at the resources you recommended. At the very least, adding the time delays you proposed would be easy to do and would not impact the VI.
As for my current question, the subVI I wish to run asynchronously performs no interactions with the calling VI, other than to close when the calling VI closes.
Does that help?
06-26-2017 01:10 AM
See below snippets for a possible solution. The new Channel wires are really handy in such cases. Note the special settings (one possible config) for the pop-up subVI: you should not allow the user close the window, also hide the Abort and other buttons. You need to set the start and stop behaviour too (show FP when called, close it if it was closed originally):
The snippets:
07-18-2019 10:04 PM
It took me a while to come to grips with the error channel. One useful purpose of wiring the error channel through the code is to enforce data execution flow. Sometimes I just use sequence structures but other times using the error channel is handy.