Jump to content

Recursion: Difference between revisions

From LabVIEW Wiki
New page: This is a stub. Feel free to edit.
 
mNo edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This is a stub. Feel free to edit.
{{underconstruction}}
'''Recursion''' in computer science is defined as a function that includes itself as part of its definition but also includes an exit condition. Put simply, '''recursion''' is a function that calls itself, until it doesn't.  In [[LabVIEW]] this means a [[VI]] that can calls itself as a [[SubVI]] where the [[SubVI]] call is in a [[Functions Palette/Programming/Structures/Case Structure|Case Structure]] so that a determination can be made whether the [[VI]] needs to call itself again or be done and return.
 
== Configuration ==
To make a [[VI]] allowed to call itself as a [[SubVI]] it must be set to [[Reentrancy|reentrant]].  To set a [[VI]] to [[Reentrancy|reentrant]]:
# Open the [[VI Properties dialog]]
# Click on the '''Category->Execution'''
# Under '''Reentrancy''' radio buttons, select the '''Shared clone reentrant execution'''
# Then click '''OK'''
 
The [[VI]] is now set to [[Reentrancy|reentrant]].  To use, simply drag the [[VI Icon]] to the VI's [[Block Diagram]].
 
== Uses ==
=== Mathematics ===
 
=== Search Tree ===
 
=== Hierarchal Data ===
 
 
== See Also ==
* [[Recursion redirect|Recursion]]
 
[[Category:Intermediate Design Patterns]]

Latest revision as of 21:07, 16 June 2020

Recursion in computer science is defined as a function that includes itself as part of its definition but also includes an exit condition. Put simply, recursion is a function that calls itself, until it doesn't. In LabVIEW this means a VI that can calls itself as a SubVI where the SubVI call is in a Case Structure so that a determination can be made whether the VI needs to call itself again or be done and return.

Configuration

To make a VI allowed to call itself as a SubVI it must be set to reentrant. To set a VI to reentrant:

  1. Open the VI Properties dialog
  2. Click on the Category->Execution
  3. Under Reentrancy radio buttons, select the Shared clone reentrant execution
  4. Then click OK

The VI is now set to reentrant. To use, simply drag the VI Icon to the VI's Block Diagram.

Uses

Mathematics

Search Tree

Hierarchal Data

See Also