Recursion with reentrant vi's

Hi all,
I have some problems with creating recursively function:
For example, I have 5 VI's that call each other in chain VI1->VI2->VI3->VI4->VI5->VI1->VI2...
At First , I made each VI as VIT and called them dynamically, it worked fine. But, calling VIT dynamically is very slow, so I've changed each VI to a reentrant and called them as is (not dynamically), and the recursion didn't worked.  Only if some VI's is VIT and some are reentrant, the recursion works.
I thought that calling VIT and reentrant VI works the same, can someone explain what is the difference between calling a reentrant and calling a VIT dynamically?
Nadav Chernin

Hi tbd,
yes I'm still around
I'm using 8.2, but I missed one thing in my screenshot that the VI options should be 0x8 (listed as action 7)
Another thing you can try is not using the VI name but the VI path to open it?
Ton
EDIT:
quicly build an example that runs on my LV OK:
Message Edited by TonP on 01-20-2007 02:15 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
recursive.png ‏7 KB
recursive.vi ‏12 KB
recursive.png ‏7 KB
recursive.vi ‏12 KB
recursive.png ‏7 KB
recursive.vi ‏12 KB

Similar Messages

  • Recursive WITH (Recursive Subquery Factoring) Never Returns

    11.2.0.2 database on Windows, SQL Developer Version 3.2.20.09, build MAIN-09.87 (Database and SQL Developer are on the same machine. I have also tried connecting to a Linux 11.2 database and have the same results.)
    I've been doing some simple testing with recursive WITH (Recursive Subquery Factoring) and when I run this following statement in SQL*Plus it returns instantly. However when running in SQL Developer it never returns, I've let it run for quite a long time (172 seconds) and gotten nothing, I finally kill the statement. Once I ran it and even killing the job didn't come back. I can get an explain plan but if I try to run it, run as script or autotrace it never returns. I have only one plan in the plan_table for this test, and it's only 4 lines long. No errors, no messages.
    WITH get_plan (query_plan, id, planlevel) as
    select ' '||operation||' '||options||' '||object_name query_plan, id, 1 planlevel
    from plan_table
    where id = 0
    union all
    select lpad(' ',2*planlevel)||p.operation||' '||p.options||' '||p.object_name query_plan, p.id, planlevel+1
    from get_plan g, plan_table p
    where g.id = p.parent_id
    SELECT QUERY_PLAN FROM GET_PLAN ORDER BY PLANLEVEL;

    Hi Jeff, using either give the same results. The query is "running", as is the little graphic with the bouncing gray bar is moving back and forth saying either "Query Results" or "Scriptrunner Task" as appropriate.
    OK this is odd. I run a count(*) on plan_table in SQL*Plus and get 4, in SQL Developer I get 487. Hun? That makes no sense I'm connect as the same user in each. Where are all these other entries coming from and why can't I see them in SQL Plus? Does SQL Developer have it's own PLAN_TABLE?
    **EDIT --- Yes that seems to be the case. The PLAN_ID I see in SQL Plus doesn't even exist in the SQL Deveropler version of the table. OK that's good to know. I assume the plan_table for SQL Developer is local to it somehow? It's not in the database as best I can see.
    Edited by: Ric Van Dyke on Feb 7, 2013 5:19 PM

  • To use "analytic function" at "recursive with clause"

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2077142
    The recursive member cannot contain any of the following elements:
    ・An aggregate function. However, analytic functions are permitted in the select list.
    OK I will use analytic function at The recursive member :-)
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> with rec(Val,TotalRecCnt) as(
      2  select 1,1 from dual
      3  union all
      4  select Val+1,count(*) over()
      5    from rec
      6   where Val+1 <= 5)
      7  select * from rec;
    select * from rec
    ERROR at line 7:
    ORA-32486: unsupported operation in recursive branch of recursive WITH clauseWhy ORA-32486 happen ?:|

    Hi Aketi,
    It works in 11.2.0.2, so it is probably a bug:
    select * from v$version
    BANNER                                                                          
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production    
    PL/SQL Release 11.2.0.2.0 - Production                                          
    CORE     11.2.0.2.0     Production                                                        
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production               
    NLSRTL Version 11.2.0.2.0 - Production                                          
    with rec(Val,TotalRecCnt) as(
    select 1,1 from dual
    union all
    select Val+1,count(*) over()
    from rec
    where Val+1 <= 5)
    select * from rec
    VAL                    TOTALRECCNT           
    1                      1                     
    2                      1                     
    3                      1                     
    4                      1                     
    5                      1                      Regards,
    Bob

  • Let us discussion "non recursive with clause" usage

    I think there are 3 "non recursive with clause" usage.
    My question is do you know more "non recursive with clause" usage ?

    Another option is to use it to materialize remote data on the fly. Especially in combination with the materialize hint.
    I think I used this tecnique once, but can't find the proper example anymore. Very simplified it could looked like this:
    with fetchData as (Select /*+materialize */ * from myremoteTable@databaselink where status = 'CURRENT')
    select *
    from fetchdata r
    full outer join localData l on r.id = r.id
    where l.status = 'CURRENT'
    ;From 11g onwards: use the with clause to create better column names in larger select from dual combinations.
    Not sure with that results in a suitable use case.
    So instead of
    with orders as
    (select 1 id , 173 order#, 'John' customer, 'America' region from dual union all
      select 2 id , 170 order#, 'Paul' customer, 'UK' region from dual union all
      select 3 id , 240 order#, 'Hans' customer, 'Europe' region from dual union all
      select 4 id , 241 order#, 'Francois' customer, 'Europe' region from dual )
    select * from orders;you can now write
    with
    orders (id, order#, customer,region) as
    (select 1 , 173 , 'John' , 'America' from dual union all
      select 2 , 170 , 'Paul' , 'UK' from dual union all
      select 3 , 240 , 'Hans' , 'Europe' from dual union all
      select 4 , 241 , 'Francois' , 'Europe' from dual )
    select * from orders;THis makes it a little easier to create tase data useing some excel sheet I guess.

  • Recursive with clause

    Hi All,
    I am using oracle 11.2.0.4
    I m using this for learning purpose
    Below is my table and insert statement
    CREATE TABLE NUMBERS(NUM NUMBER);
    INSERT INTO NUMBERS VALUES(1);
    INSERT INTO NUMBERS VALUES(2);
    INSERT INTO NUMBERS VALUES(3);
    INSERT INTO NUMBERS VALUES(4);
    WITH RSFC(ITERATION,RUNNING_FACTORIAL) AS
    (SELECT NUM AS ITERATION,
    1 AS RUNNING_FACTORIAL
    FROM NUMBERS
    WHERE NUM=1
    UNION ALL
    SELECT R.ITERATION+1,
            R.RUNNING_FACTORIAL * B.NUM
            FROM RSFC R INNER JOIN NUMBERS B
            ON (R.ITERATION+1) + B.NUM    
            SELECT ITERATION,RUNNING_FACTORIAL
            FROM RSFC
    I am learning recursive with clause
    when I am trying to execute the query I am getting
    ORA-00920 : invalid realtional operator
    what is wrong in this query,please help me
    Thanks and Regrds,
    Subho

    Hi,
    2937991 wrote:
    Hi All,
    I am using oracle 11.2.0.4
    I m using this for learning purpose
    Below is my table and insert statement
    CREATE TABLE NUMBERS(NUM NUMBER);
    INSERT INTO NUMBERS VALUES(1);
    INSERT INTO NUMBERS VALUES(2);
    INSERT INTO NUMBERS VALUES(3);
    INSERT INTO NUMBERS VALUES(4);
    WITH RSFC(ITERATION,RUNNING_FACTORIAL) AS
    (SELECT NUM AS ITERATION,
    1 AS RUNNING_FACTORIAL
    FROM NUMBERS
    WHERE NUM=1
    UNION ALL
    SELECT R.ITERATION+1,
            R.RUNNING_FACTORIAL * B.NUM
            FROM RSFC R INNER JOIN NUMBERS B
            ON (R.ITERATION+1) + B.NUM   
            SELECT ITERATION,RUNNING_FACTORIAL
            FROM RSFC
    I am learning recursive with clause
    when I am trying to execute the query I am getting
    ORA-00920 : invalid realtional operator
    what is wrong in this query,please help me
    Thanks and Regrds,
    Subho
    The error actually has nothing to do with the WITH clause.
    Join conditions (that is, the conditions following the ON keyword) must be expressions that evaluate to TRUE or FALSE.  The join condition you posted, however
    (R.ITERATION+1) + B.NUM   
    evaluates to a NUMBER.  The following would be a valid join condition:
    (R.ITERATION+1) = B.NUM  
    but I have no idea if that's what you wanted or not.

  • Since Oracle11gR2,"recursive with clause" is supported.

    http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/aggreg.htm#i1007241
    <i>Note that Oracle Database does not support recursive use of the WITH clause</i>
    This is wrong.
    Since Oracle11gR2 recursive with clause is supported.
    Please fix this wrong statement of document.
    I like recursive with clause 8-)

    I'm the writer for this doc, and you are correct. This sentence was not removed when the 11.2 doc was updated, and it should have been. I have removed it for the 12g doc.

  • How to use recursion with images

    Ok, for this program I'm trying to recursively repeat an image 3 times with varying widths and heights, and I don't know how to do that with images. With rectangles and other shape objects it's easy because all I had to do was override the draw method, but with images I'm not sure what to override to allow me to repeat the drawing of it with a different height and width. Any help would be greatly appreciated.

    Would I be able to work that in with recursion? Currently I have a JPanel with the paintComponent method being overridden, and I've tried setting up the paintComponent method to call itself to repaint the image, but I've realized everytime I resize the application's window paintComponent gets called again making the images go out of site. Is there a way to override the drawImage method to allow me to change the width and height of the image without causing the panel to repaint itself?

  • Recursion with Return instruction without parameter

    Please I have a doubt about following code:
    public void solveTowers( int disks, int sourcePeg, int destinationPeg,
    int tempPeg )
    if ( disks == 1 )
    System.out.printf( "\n%d --> %d", sourcePeg, destinationPeg );
    return;
    solveTowers( disks - 1, sourcePeg, tempPeg, destinationPeg );
    System.out.printf( "\n%d --> %d", sourcePeg, destinationPeg );
    If I enter witch amount variable DISK = 3
    I'd like to known: Why ouput after perform the code is
    1--->3
    2--->3
    1--->3 ?
    I didn't get it about the mechanism logical of RETURN instruction !!!
    Please, some could me help and explain about with mechanism
    OBS: An draw or design it will be helpfull for me understant
    A lot of thanks
    Gmourad

    You didn't mention other parameters of your recursive method, so I am not guessing but here is an easier example.
    public class Test{
         public void resursive(int num) {
              if (num == 1) {
                   System.out.println(num);
                   return;
              resursive(--num);
              System.out.println(num);
        public static void main(String[] args) {
              int num = 3;
              Test myTest = new Test();
              a.resursive(num);
    1
    1
    2
    recursive(3) -> recursive(2)                                          // print 2
                    recursive(2) -> recursive(1)              // print 1
                                    recursive(1) -> // print 1It would print the last one first because the upper one would call itself first before print out the value.

  • Request deallocation function with reentrant clones

    I have a standalone application (Labview version 12) that is processing very large chunks of data. Each batch run can take hours to complete.  I am storing all intermediate data in files to avoid running out of memory but still I am having occasional issues of running out of memory.  I never have an error on the first batch, only on the 2nd or 3rd.  I am experimenting with using the request deallocation function at the end of each batch but I am not clear on how/when it takes affect.
    There are 2 sub VIs that do all the work so I have placed the request deallocation in these with a boolean input to be true the last time it is called.  After the last call, the main application is idle waiting for the user to request another batch so this seems like the logical time to deallocate. These subs are configured as shared clone reentrant. They also have subs 2-3 levels deep.  How does the request for deallocation take effect for reentrant VIs?  Are all clones deallocated or just one?  What about VIs called within a deallocated sub? Are they included in the garbage collection or does each sub VI called have to be deallocated seperatly?

    Hi chiraldude
    I think that if the SubVI is not dynamic, (being part of the application) it will be keep in memory while the top level VI is running. If you load the VI dynamically, the deallocation will be done when all references are closed.
    The last time I poked around with the de-allocate, it only cam e into play when the VI in question was marked for removal from memory. If the sub-VI is part of the app (not dynamic) it will not be marked for removal while the top-level VI is running.
    However, I would like to recomen another tool that might come in very handy with this case, the place element structure.
    http://zone.ni.com/reference/en-XX/help/371361G-01/glang/in_place_element_structure/
    Regarding memory administration, this links might be useful as well
     How Can I Optimize the Memory Use in My LabVIEW VI?
    http://digital.ni.com/public.nsf/allkb/771AC793114A5CB986256CAB00079F57?OpenDocument
    Determining When and Where LabVIEW Allocates a New Buffer
    http://digital.ni.com/public.nsf/allkb/C18189E84E2E415286256D330072364A?OpenDocument
    Warm Regards
    Fabián M.
    Internal Sales Engineer
    National Instruments

  • Importing a package recursively (with subpackages)

    Hello everyone,
    I'm a 1st-year CS major and am new to Java. I had a question about importing packages. As I understand it, when you use a wildcard when importing, it will import the classes within the package specified before the asterisk, but none of the subpackages in the specified package.
    Sort of like in Linux when you have to pass the -R (recursive) argument to list files contained deeper within the directory hierarchy.
    My question is, is there a way to include all classes and subpackages with a single line, instead of doing:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    I understand that it doesn't actually cause any bloat in your bytecode, so if it can be done, would there be any disadvantage?
    Thanks!

    jverd wrote:
    E_Rutherford_Jollyworth wrote:
    Hello everyone,
    I'm a 1st-year CS major and am new to Java. I had a question about importing packages. As I understand it, when you use a wildcard when importing, it will import the classes within the package specified before the asterisk, but none of the subpackages in the specified package. Correct. There aren't really "subpakcages." The JLS actually uses that term, but I don't know why. There's no real hierarchy, other than the one on the filesystem and the logical one implied by the names. As far as Java is concerned, the packages have no relation to each other.
    YET.
    There are plans (I think approved by the JCP) to enable importing of class hierarchies in JDK 7. Not my favourite idea, but others seem to think differently.
    I understand that it doesn't actually cause any bloat in your bytecode, so if it can be done, would there be any disadvantage?If it could be done, the disadvantage would be the same as that of using the *** wildcard to import all the classes at a single level. Namely, it's not clear which class comes from which package.Worse than that. If you have identically named classes in deeper packages which one is going to be used? You just can't tell, which hopefully will generate a compiler error.
    For example you import com.acme.dummy recursively, which has com.acme.dummy.one.SomeClass and com.acme.dummy.two.SomeClass.
    Now use SomeClass in your code without specifying the package name with it and you're in trouble.

  • Recursion with array

    hi
    i got this question , int values[] int index int amount i need to check if there is sum of elementv in values that equal to amount
    example
    values[]={5,22,13,5,7,-4}
    amount=31
    22+13+(-4)=31
    return true
    the signature fo function call in recursion is:
    cover (int[] values,int i,int amount)

    henvertis, you hijack someone else's thread to post your "question". I suggest you to create a thread of your own and tell you that it might be a good idea to post the code you're working on because just posting a description of the problem might result into other forum members assuming you just want someone to do it for you (some call this cheating).
    You then create a new thread, but (again) just with the problem description. I respond to that thread but you never got back to me, and now you're back again with another new thread and again just the problem description!
    What's wrong with you?

  • Recursion with binary numbers

    I need to print out a list of all possiblle binary numbers with as many digits as an int k. For example, if k = 3, it would need to print out 000,001,010,011,100,101,110,111. for k = 2 it is only 00, 01, 10, 11. It is pretty clear that for any k, a recursive technique can be used to solve this problem, but I'm having trouble finding the solution. Please help. Thanks

    You don't need recursion:for (int i = 0, max = 1 << (k - 1); i < max; ++i) {
      print binary i to k digits
    }But a recursive approach would be void increment (int[] data, int digit) {
    if (digit > 0) {
    --digit;
    for (int i = 0; i < 2; ++i) {
      data[digit] = i;
      increment(data, digit);
    } else {
    print contents of data array
    start (int k) { increment(new int[k], k); }Neither code tested.
    Pete

  • Recursion with arrays

    Hi,
    I am having trouble with creating a recursive method to sum all
    elements in an array. I am new to recursion and am getting
    confused.
    Here is a method I am working with:
    I am trying to sum all the sides of a triangle whose sides
    are stored in the array sides [ ], but can't seem to add
    more than the sides[2] and sides[1] elements.
    Any ideas? One of the requirements is that 0<= index < size or array.
    Thanks,
    int perimeter() {
    return perim(0);
    int perim(int index) {
    if (index == sides.length-1)
    return sides[index];
    else{
    int sidesTotal = perim(index+1);
    return sidesTotal + sides[index-1];
    }

    > I am having trouble with creating a recursive method
    to sum all elements in an array. 
    class ReallyBadUseOfRecursionDemo {
        public static int recursiveSum(int[] array) {
            if (array == null || array.length == 0) return 0;
            if (array.length == 1) return array[0];
            return array[0] + recursiveSum(java.util.Arrays.copyOfRange(array, 1, array.length));
        public static void main(String[] args) {
            assert 0 == recursiveSum(null);
            assert 0 == recursiveSum(new int[0]);
            assert 42 == recursiveSum(new int[] { 42 });
            assert 6 == recursiveSum(new int[] { 1, 2, 3 });
    }~

  • Recursion with strings

    Hallo,
    I have to write a method that get's two String type strings (s1, s2) and returns the length of the the biggest continuous sub matrix in the matrix s2 that's all it's digits are present in matrix s1.
    For example: if s1 is "xyz" and s2 is "abxyryxzycx" the method will return 4 because the length of sub matrix "yxzy" is 4 and it's the largest sub matrix of s2 that contains only digits from s1(the sub matrices are: "xy", "yxzy", "x").
    I have to write this method with recursion and I'm not allowed to use any strings.
    When I'm using the defined methods of the String class I can use only the following one's:
    public char charAt (int i)
    public int indexOf (int ch)
    public int length()
    public String substring (int i)
    I can's see right now how I use "if" conditions with the String methods I'm allowed to use and I can't see the process of solving the problem(should I use linear search?).
    Thank's to everybody that can help.
    Edited by: ArikG on Jan 26, 2009 10:38 AM

    I suppose I have to use linear search, but I can't use it here because I'm not allowed to use loops.
    My idea is that if the linear search in s2 a digit from s1 is found so I use the method: public char charAt(int i) and from this point I don't know what to do, and I don't know if it's possible to use linear search in recursion(I know how to do it with loops) and how to write everything here(I am familiar only with the String length methods because we weren't taught in the course about the other Sting methods)

  • Bug discovered in LabVIEW 8.5.1 with reentrant VIs

    Hi NI,
    I discovered a bug with the way LabVIEW handles the state of front panel controls for reentrant VIs that have the front panel open during execution.  Essentially, what is happening is that the Boolean text on the FP button is not getting updated properly.  Sometimes it will update correclty, other times it won't.  This makes the bug intermittent.
    Please see the attached example code for a demo.
    Doing the following does NOT make the bug go away:
    reentrant_gui.vi --> VI Properties --> Execution --> Check "Clear indicators when called"
    Doing the following does make the bug go away:
    reentrant_gui.vi --> VI Properties --> Execution --> Select "Preallocate clone for each instance"
    However, in theory it should not be necessary to preallocate a clone since the FP values are wired into the vi before it is called (see the simple demo code).  Plus, for my application, I need to minimize the amount of RAM occupied by my program, so I don't want to preallocate clones for each instance.
    Cheers,
    Richard
    Attachments:
    lv_reentrant_bug_illustrated.llb ‏35 KB

    I'm running 8.6.1, and I see what I would expect, when I run your code
    Your instance:
    copies NUMERIC IN to NUMERIC OUT
    Copies its BOOLEAN's property BOOLTEXT.TEXT to STRING OUT
    Sets its BOOLEAN's property BOOLTEXT.TEXT from STRING IN
    Reads the BOOLEAN  (no effect)
    Waits 100 mSec
    You call two of these in a loop, one fed with the loop counter "i", and a string of "i", the other called with 0.0, and "blah"
    The first time up, I don't know what I'll get from the STRING OUT, it depends on what the BOOLTEXT.TEXT property is set to.
    The NARRAY 1 is labeled "should contain 0 to N", and it indeed should contain 0 to N-1, and it does.
    The NARRAY 2 is labeled "should contain all 0s, and it indeed should, and it does.
    The SARRAY 1 is labeled "should contain all OKs". but it really should  contain the strings "X","0',"1","2","3",... where X is indeterminate the first time up.
    The SARRAY 2 is labeled "should contain all OKs, but it really should contain all "blah"s, and it does.
    I don't know why you are expecting "OK".
    I see no bug at all. 
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

Maybe you are looking for

  • Switching from PC to Mac - Iphone issues

    Hi....jus got myself a macbook 2.4ghz model....I got an iphone 3g which i used with a windows laptop... I've copied all my songs into a portable disk drive and plan to move that to the mac.....once i upload the songs into itunes....and connect my iph

  • Flash Player crashing in Firefox

    System is: MacBook Pro OS X 10.10.2 (14C1514) Firefox 37.0.1 Flash Player 17.0.0.134 Any web site with flash video causes the beach ball spinner, firefox freezes, flash then crashes and firefox unfreezes. This has been happening through different ver

  • Revenue recognition has been executed twice

    HI all G/L Balance is not correct as below. It looks that some of revenue recognition has been executed twice. There are both items that revenue recognition has been executed twice and items that revenue recognition has been executed once within the

  • Why do i get a thin tear moving thru my video when playing on my lcd?

    Why do i get a tear thru my video when playing on my lcd? I have tryed 60mhz monitors & 120's but I still get a single thin  tear moving through the image. It happens mainly with HD footage when there is a lot of camera movement. I have an invidia gt

  • Firefox keeps crashing UserCallWinProcCheckWow

    firefox keeps crash and im trying to find out why. i installed a new version which didnt help. the about:crashes says UserCallWinProcCheckWow any idea whats causing it or how i can find out