ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

recursion in labview

Is it possible to write recursive functions in labview? I have created complex data structures which have a name and a reference to child nodes to simulate a tree structure and I need to do a recursive xapansion of the tree. This can be done very easily with resursion but I keep getting the "can not use vi recursivly" error message when I try to perform such a coded algorithm. I have set the vi to reentrent but still cant get this to work. I am using LV7.0 is this possible or is it a lost cause. I can simulate recursion but this is not as fast or elligant as the simple recursive solution. Any references to recursion in labview would be greatly appreciated.

Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 1 of 4
(3,929 Views)
There is an example VI here with a discussion on how to use passing references. Don't be put off by the first response shown...

http://forums.ni.com/ni/board/message?board.id=170&message.id=29886&requireLogin=False
0 Kudos
Message 2 of 4
(3,919 Views)
Hi

Have a look at this thread.

There I traverse through a tree using recurstion.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 3 of 4
(3,915 Views)
Paul,


Actually, recursion is not very difficult to do.


Just make a vi reentrant, and call it dynamically. Debugging is a problem, but you can use popup message boxes (, or make a buffer vi with floating panel so you can see what is happening).


I don't have 7.0 working, but you should be able to open this 6.1 example. Sorry, the example is a bit stupid...


Regard,


Wiebe.


"falkpl" <x@no.email> wrote in message news:211395@exchange.ni.com...
Is it possible to write recursive functions in labview? I have created complex data structures which have a name and a reference to child nodes to simulate a tree structure and I need to do a recursive xapansion of the tree. This can be done very easily with resursion but I keep getting the "can not use vi recursivly" error message when I try to perform such a coded algorithm. I have set the vi to reentrent but still cant get this to work. I am using LV7.0 is this possible or is it a lost cause. I can simulate recursion but this is not as fast or elligant as the simple recursive solution. Any references to recursion in labview would be greatly appreciated.<br><br>Paul
0 Kudos
Message 4 of 4
(3,748 Views)