LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indirect recursion not working

Hi all,

I was working with direct recursion (function A calls function A) which is fairly easy.  But when I do it indirectly (function A calls function B calls function A) it breaks.  Anybody know why and how I can get around the problem?

I've attached some sample VIs for you to play with.  Factorial3-orig.vi and Factorial4-orig.vi call each other.

callchain_to_string.vi just shows the stack.  I know that I am using the error box incorrectly, but this is just for testing.

Thanks for your help.


Adrian

BTW, I'm using LV 7.0.

Message Edited by Been bitten by LabVIEW on 10-16-2007 04:58 PM

0 Kudos
Message 1 of 10
(3,661 Views)
Further to my last post, I also tried with option 8 (prepare for reentrent run) without success.  The VI are set to be reentrent anyway.

Just wanted to clarify what I have attempted.


Adrian
0 Kudos
Message 2 of 10
(3,653 Views)
using LV8.2 i do not have any problem. the recursion seems to work perfectly. what do you see break? does LV crashes?
will reinstall LV7.1 and check later on.
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 3 of 10
(3,649 Views)
I tried it in 8.0 and it errored out.  Error code of 0.
Jim

LV 2020
0 Kudos
Message 4 of 10
(3,645 Views)
He is always setting the status bit to True.  He is getting no error in LV8.x, but in 7.1, it will give an error 1042, recursive call attempt.
Message 5 of 10
(3,640 Views)
I don't have an old enough LV version installed to check, but have you tried passing 8 to the options parameter of both "Open VI Reference" nodes.
0 Kudos
Message 6 of 10
(3,629 Views)
I beleive Matthew K nailed it with his response.
 
Indirect recursion was added (with no fan fair) in about LV 8.
 
We discussed this in a my Cotrol Reference Nugget starting at about reply #49.
 
JPD was suprised it worked!
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 10
(3,614 Views)

@Ben wrote:
I beleive Matthew K nailed it with his response.
 

What do you mean about the status bit?  Are you refering to the error out?



@Ben wrote:

Indirect recursion was added (with no fan fair) in about LV 8.
 
We discussed this in a my Cotrol Reference Nugget starting at about reply #49.
 
JPD was suprised it worked!
 
Ben


'k, sound like I am stuck with using loop iteration with my own stack or expanding the called code inline to remove the mutual recursion or (of course) update to the latest LV (which the company will probably be doing in a few months).  Sucks.  😞


Adrian

Message Edited by Been bitten by LabVIEW on 10-18-2007 08:45 AM

0 Kudos
Message 8 of 10
(3,590 Views)

Hi Adrian,

There is no need to upgrade.

JPD offered a suggestion in that Nugget's thread on how to handle that limitaion. In an nut-shell, you put both of the VI's you want to call in a single VI and control which of the two flavors execute.

BTW:

If you need to code to run fast, the none recursive method will perform much better.

I hope that help,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 10
(3,582 Views)


@Ben wrote:

Hi Adrian,

There is no need to upgrade.

JPD offered a suggestion in that Nugget's thread on how to handle that limitaion. In an nut-shell, you put both of the VI's you want to call in a single VI and control which of the two flavors execute.


Yeah, I understood that.  By expanding the code inline it would get around the problem.  But I'm not going to do that since it would couple my code way too closely.  It took a day, but I've implemented an iterative method.  Not as elegant or as easy to read, but it works.  LV is a PITA!! 

Oh well, just have to push LV past its limit so that I can find its limit.  Then I can back off a bit and get things done. 😉


Adrian
0 Kudos
Message 10 of 10
(3,571 Views)