05-16-2019 06:40 AM
@SarmaHari wrote:
Replying to Ben (message 5)
Please find attached a quick recursive vi (re-entrant) saved for LabVIEW Version 15. Very basic, not much of error handling etc.,
- "open a reference to the target VI ", would obviously fail, if I rename a vi.
On my present computer, I do not have NXG , so can not give a copy. However I tested. As the behavior of CG & NXG LV's different, when copying a recursive file at Windows (OS) level, I see the following problem
1. If there is a set up that, has set of shell scripts (or batch files or any scripting language files) that rename ("ren" in windows , "mv" in Linux) a recursive file and executes, in this kind of setup, changing CG LV to NXG LV files would not suffice. Changing the script is also required
2. Assuming Nestedness (stack depth) of recursive file is same in CG & NXG, NXG would go one more level extra. That is because NG first invokes new file, which invokes old (before renaming) file
You've lost me there.
05-16-2019 07:42 AM - edited 05-16-2019 07:43 AM
wiebe@CARYA wrote:
@SarmaHari wrote:
Replying to Ben (message 5)
Please find attached a quick recursive vi (re-entrant) saved for LabVIEW Version 15. Very basic, not much of error handling etc.,
- "open a reference to the target VI ", would obviously fail, if I rename a vi.
On my present computer, I do not have NXG ,...
You've lost me there.
I am confused as well. Is this an issue with NXG?
I am not of much help with NXG since I never actually touched it.
Somehow the new look and feel makes me cringe. I get the impression my nice fine point pen is replaced with crayons and the hidden config of every widget hides the implementation requiring I poke at everything making "reading the code at a glance" as we can do with CG. And then there is that waste of screen with those silly windows ... Boy have I digressed!
Now to offer the "old-school" approach to recursion in LabVEW. In this Nugget I wrote about control refs and offered an approach that let us navigate into undefined nested arrays of clusters in arrays etc. Here is a screen shot from that Nugget.
As shown the VI opens a ref to itself and then invokes itself.
Speaking about CG...
I usually avoid recursion since it is hard to follow ( for me), incurs memory overhead for each recursion, and the last time I checked, abort a VI after single stepping into the stack would crash LV.
Not sure if any of that helps but sometimes just scattering ideas helps.
Ben
11-12-2019 12:21 PM
Almost on-topic: When did LabVIEW (version?) allow the VI to call itself directly without invoking it?
11-13-2019 03:30 AM
@BVSmith wrote:
Almost on-topic: When did LabVIEW (version?) allow the VI to call itself directly without invoking it?
If I had to guess 7 or 8.