08-03-2010 12:39 PM
Why wont this VI work when you set it to go from say 20->-60??
08-03-2010 12:40 PM
Scrap that... I can see why, but how do I modify it?
08-03-2010 12:47 PM
Flip-flop you start and end then use "reverse Array" function from the array palette.
For those that don't want to peek at the code...
Recursive VI that calls itself as long as we have not reached the end. It assumed all posive values so this check fails and the recursion never happens.
Ben
08-03-2010 12:58 PM
I rarely use recursion because I find it hard to follow in most cases, and in most cases it uses more resources than it has to. So attached is the While Loop recursion method that doesn't call it self over and over. It also uses the auto index function so there are no build array functions.
I've also added a Min/Max function that ensures that the Start is before the End.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-03-2010 01:10 PM
That is good and all, but what if I want my array to come out with the larger number first?
08-03-2010 01:10 PM
Which I do
08-03-2010 01:11 PM
I made this, but don't know how to make it recursive...
08-03-2010 01:11 PM
As the original context shows, this VI is a toy aimed to show the principles behind native recursion and not to replace the loop construct. The Ramp.VI in the signal generation palette is a perfectly suitable solution for the real application. For the much more interesting academic exercise, the recursive VI should be modified at will.
That particular VIOTD did not generate much excitement, so I guess it wasn't explored much then.
Every now and then when I revisit one of those threads I start to get the itch again.
08-03-2010 01:24 PM
Anyone got any more Ideas
Nothing has really worked yet
08-03-2010 01:25 PM
There was no original context with this post. I had no idea that it was intended to show LabVIEW's recursive feature. That being said if you want the larger number first just reverse the array at the end, it's a native function in the array palette.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord