Pollux Posted October 8, 2008 Report Share Posted October 8, 2008 Is it possible to write a recursive subVI in LabView 8.0? If yes, where can I find some good documentation about tha? Thank you! Quote Link to comment
LAVA 1.0 Content Posted October 8, 2008 Report Share Posted October 8, 2008 QUOTE (Pollux @ Oct 7 2008, 09:31 AM) Is it possible to write a recursive subVI in LabView 8.0? Yes it is, using VI server. Look this http://forums.lavag.org/SHAREcompute-factorial-using-recursion-t1543.html' target="_blank">thread For faster performance, you should consider doing recursion on the data only. Goog luck! Quote Link to comment
Aristos Queue Posted October 8, 2008 Report Share Posted October 8, 2008 Using VI Server you can do recursion. It is not as simple as "drop a subVI on its own block diagram" but it does work. See previous post from user pdc for details. For the more direct recursion, you need LV 8.5 or later. (In LV8.5, see <labview>\examples\lvoop\recursion\ for details.) Quote Link to comment
jzoller Posted October 8, 2008 Report Share Posted October 8, 2008 Keep in mind that using a stack (http://en.wikipedia.org/wiki/Stack_(data_s...e)#Applications, for instance) can be far more efficient than using recursion in LV. It may require painful architectural changes though. Joe Z. Quote Link to comment
Pollux Posted October 9, 2008 Author Report Share Posted October 9, 2008 QUOTE (jzoller @ Oct 7 2008, 07:51 PM) Keep in mind that using a stack (http://en.wikipedia.org/wiki/Stack_(data_s...e)#Applications, for instance) can be far more efficient than using recursion in LV. It may require painful architectural changes though.Joe Z. actually I am working on an iterative version of my application using a stack. I am not a big fan of recursive functions, not even in classical languages as C or Pascal. but I was wondering if recursion exists in LV 8 and I will read something about that. maybe sometimes it will come handy. edit: I have another question, and I'm not opening a separate thread for it: Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way. Is there any other way to do this type of application? Quote Link to comment
LAVA 1.0 Content Posted October 9, 2008 Report Share Posted October 9, 2008 QUOTE (Pollux @ Oct 8 2008, 04:45 AM) ...edit: I have another question, and I'm not opening a separate thread for it: Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way. Is there any other way to do this type of application? I see nothing bad with event driven architrectures. I use them for almost all of my GUI's and with user events i have extended their use to more than just the GUI. The "old way" used polling which almost shapes out the same but puts additional load on the CPU to do the polling and introduces a delay if you throttle the polling. Ben Quote Link to comment
TobyD Posted October 9, 2008 Report Share Posted October 9, 2008 QUOTE (Pollux @ Oct 8 2008, 01:45 AM) edit: I have another question, and I'm not opening a separate thread for it: Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way. Is there any other way to do this type of application? I agree with Ben on this one. The event driven architecture is easy to implement and one of the most efficient ways to implement the kind of program you refer to. The method of polling for changes to your buttons inside a while loop wastes processor time and generally responds more slowly than the event structure. Toby Quote Link to comment
Aristos Queue Posted October 9, 2008 Report Share Posted October 9, 2008 QUOTE (Pollux @ Oct 8 2008, 03:45 AM) I have another question, and I'm not opening a separate thread for it:Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way. Is there any other way to do this type of application? a) The event structure is *the* way to do UI programming. Polling loops or any other style are not recommended for a host of reasons. Any examples you saw that claim to be demos of user interface programming that are not using the event structure are antiquated. b) I found a whole lot of example programs that use the event structure. Just use Help>>Examples and search for "events" keyword. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.