Restarting a elapsed time function in a for loop

Hello,
I am having an issue while using an elasped time function inside of a while loop (I wire the Time has elapsed? boolean to the stop function of the while loop), that is consequently inside of a for loop.  The elapsed time function works correctly on its own in a while loop, but when added to a for loop will not reset for each iteration of the for loop.  I can post an example if it is needed, but has anyone run into this problem before?  I have tried wiring all the reset boolean's but I cannot get the timer to reset untill the for loop has finished.
Any suggestions on how to achieve this another way are welcome.
Thanks,
Andrew

I found the issue, I was using 2 timers inside of the for loop on the assumption that they are completely independant of one another....they are not.  if time has elapsed on one timer then it uses that time to start off the next timer, kind of a wierd behaviour but I guess I am not really using the timer in a normal manner.
Andrew

Similar Messages

  • How to use elapsed time function with state machine in Lab VIEW

    Hello
    I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true  signal to move to the next state. 
    Could you please have a look to my code and help me to solve this issue.
    Regards 
    Rajab
    Solved!
    Go to Solution.
    Attachments:
    daq assistance thermocouple(sate machine raj).vi ‏436 KB

    Rajab84 wrote:
    Thanks apok for your help
    even with pressing start it keeps running on wait case 
    could you please explain the code for me, the use of Boolean crossing, increment , and equal functions 
    Best Regards 
    Rajab 
    OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
    run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
    "start"= false, stay in current state. If true, transition to "1 min" case
    reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
    reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
    Once cycle count reaches 2, stop while loop.... 
    Attachments:
    Untitled%202[1].vi ‏42 KB

  • Elapsed timer function

    Bonjour,
    Je vous expliques en quelques lignes mon problème.
    Je possède un compactRIO 9024, qui fera des mesure de résistance avec une carte NI 9219.
    Je dois alimenter la bobine d'un relais (branchéé sur un contact), et démarrer un compteur à ce moment
    Ensuite, le compactRIO devra mesurer la valeur de la résistance du contact du relais et stopper le compteur lorsque ce contact sera fermé (résistance nule ou proche de 0)
    Ce test doit permettre de calculer le temps que le relais met entre le moment où sa bobine est alimenté ou le moment où le contact est réellement fermé.
    J'ai pensé à utiliser la fonction Elapsed Timer function, mais je n'arrive pas à la faire fonctionner.
    Quelqu'un aurait il un exemple ou une autre méthode?
    Merci

    Bonjour,
    Je me suis amusé à vous faire une FGV timer qui renvoie des milliseconde (avec LV2010 et 2009 au cas ou):
    Que vous pouvez mettre sur votre partie RT, en gros cet FGV à 4 etat:
    Init pour reinitialiser le timer.
    Start pour lancer le timer
    Stop pour stoper le timer
    Get pour avoir la valeur du timer.
    J'espere que cela vous rendra service.
    Cordialement.
    Nacer M. | Certified LabVIEW Architecte
    Pièces jointes :
    timer.vi ‏10 KB
    timer2009.vi ‏8 KB

  • Help with quit function and elapsed time function.

    I have this annoying assignment game here and I am almost finished with it. I got two problems, the first is that the quit function partly works it quits from the game but it is giving me a "Guess is to high" message. I've tried so many things but nothing seems to work.
    The other problem is that the elapsed time " *(long f = System.currentTimeMillis()/1000;)* " starts to count before you actually write something for example if you run the program without writing something for 5 minutes, the highscore list will show your time you finished the game + these 5 minutes.
    If somebody could give me a hint or could explain to me how I could fix these problems I would be very thankful.
    import java.util.*;
    class Game  {
         public static void main(String[] arg) {
              int RAN,Entered_number=0,count=0;
              String guess1[] = new String[1];
              int guess2[] = new int[1];
              int time[] = new int[1];
              String NP1[];
              int NP2[];
              int NP3[];
              int j=0;
              Scanner scan=new Scanner(System.in);
              Scanner kb = new Scanner(System.in);
              Random myRandomizer = new Random();
              RAN= Math.abs(myRandomizer.nextInt() % 1000) + 1;
              System.out.println("\t\t\t"+"Hello and welcome to this guessing game!");
              System.out.println("\t\t\t"+"Start guessing, it's a number between 1 and 1000...");
              System.out.print("--------------------------------------------------");
              System.out.println("-----------------------------");
              System.out.println("please enter your number:");
              String control="";//control is just a name for the variable. it's used to read in the whole line if you have written something that is not a number.
              String name="";
              String answer="";
              boolean okgame=true;//is used so that you can play the game as long as the variable okgame is true.
              long f = System.currentTimeMillis()/1000;
              while((Entered_number!=RAN) && okgame)//controls if the number is different then RAN and that okgame is true.
                   System.out.print(RAN);
                   System.out.print(">");
                   if(scan.hasNextInt())//checks in advance that what you have written is a number, if so then it can read it as Entered_number.
                        Entered_number=scan.nextInt();
                   else
                        control=scan.nextLine();//Reads int the whole line to control what has been written in.
                        if(control.equalsIgnoreCase("quit"))//if control is = quit, then compare to will return 0.
                             okgame=false; //if you have written quit okgame, you put in false to quit the game.
                             // Entered_number=0;//initiates entered_number all over again to show message stupid guess i wont count that.
                   if(okgame)//as long as okgame is true it will show the result otherwise you go to else to show that the game is finished.
                        if((Entered_number>RAN)&&(Entered_number>=1)&&(Entered_number<=1000))
                             System.out.println("Guess is too high!");
                             count++;
                        else if((Entered_number<RAN)&&(Entered_number>=1)&&(Entered_number<=1000))
                             System.out.println("Guess is too low!");
                             count++;
                        else if((Entered_number>1000)||(Entered_number<1))
                             System.out.println("Stupid guess! I won't count that...");
                        else if (Entered_number==RAN)
                             long p = System.currentTimeMillis()/1000;
                             count++;
                             System.out.println("****Guess is CORRECT!");
                             System.out.print("****You guessed it in"+" "+count+" guesses and ");
                             System.out.print(p - f);
                             System.out.println(" seconds.");
                             System.out.println("please enter your name:");
                             System.out.print(">");
                             name=kb.next();
                             System.out.println("Do you want to play again ?(y/n)"); 
                             System.out.print(">");
                             answer=kb.next();
                             if(answer.equalsIgnoreCase("n"))
                                  System.out.println("**** The game is over.");
                                  okgame=false;
                             if(answer.equalsIgnoreCase("y"))
                                  Random myRandom = new Random();
                                  RAN = Math.abs(myRandom.nextInt() % 1000) + 1;
                                  System.out.println("current high score list:");
                                  long ttime = p-f;
                                  int ta = (int)ttime;
                                  j++;
                                  if (j > 1){
                                       NP1 = new String[j];
                                       NP2 = new int[j];
                                       NP3 = new int[j];
                                       for (int n = 1; n < j; n++){
                                            NP1[n-1] = guess1[n-1];
                                            NP2[n-1] = guess2[n-1];
                                            NP3[n-1] = time[n-1];
                                       NP1[j-1] = name;
                                       NP2[j-1] = count;
                                       NP3[j-1] = ta;
                                       guess1 = new String[j];
                                       guess1 = NP1;
                                       time = new int[j];
                                       guess2 = new int[j];
                                       guess2 = NP2; 
                                       time = NP3;
                                       for (int w = 1; w < guess2.length; w++) {
                                            for (int x = 1; x < guess2.length; x++) {
                                                 if (guess2[x] < guess2[x-1]) {
                                                      int z4, z5,z6,z7;
                                                      String z2, z3;
                                                      z4 = guess2[x];
                                                      z5 = guess2[x-1];
                                                      guess2[x] = z5;
                                                      guess2[x-1] = z4;
                                                      z2 = guess1[x];
                                                      z3 = guess1[x-1];
                                                      guess1[x] = z3;
                                                      guess1[x-1] = z2;
                                                      z6 = time[x];
                                                      z7 = time[x-1];
                                                      time[x] = z7;
                                                      time[x-1] = z6;
                                       for (int al = 1; al < time.length; al++) {
                                            for (int o = 1; o < time.length; o++) {
                                                 if (guess2[o] == guess2[o-1]) {
                                                      if (time[o] < time[o-1]) {
                                                           int z4, z5, z6 ,z7;
                                                           String z2, z3;
                                                           z2 = guess1[o]; z3 = guess1[o-1];
                                                           z4 = guess2[o]; z5 = guess2[o-1];
                                                           z6 = time[o]; z7 = time[o-1];
                                                           guess1[o] = z3; guess1[o-1] = z2;
                                                           guess2[o] = z5; guess2[o-1] = z4;
                                                           time[o] = z7; time[o-1] = z6;
                                  else {
                                       guess1[j-1] = name;
                                       guess2[j-1] = count;
                                       time[j-1] = ta;
                                  System.out.println("Number\t\tName\t\tHigh Score\tTime (Seconds)");
                                  System.out.println("------\t\t----\t\t----------\t--------------");
                                  for (int h = 0; h < j; h++) {
                                       System.out.println(" " + (h+1) + "\t\t" + guess1[h] + "\t\t" + guess2[h] + "\t\t" + time[h]);
                                  System.out.println("");
                                  System.out.println("Start guessing, it's a number between 1 and 1000...");
                             count=0;
    //-----------------------------------------------------------------------------------------------------------------------------------------------------PS I'm not done with the comments yet so that could be a little confusing for you guys =P
    Thanks!
    /chill

    else {
                                       guess1[j-1] = name;
                                       guess2[j-1] = count;
                                       time[j-1] = ta;
                                  System.out.println("Number\t\tName\t\tHigh Score\tTime (Seconds)");
                                  System.out.println("------\t\t----\t\t----------\t--------------");
                                  for (int h = 0; h < j; h++) {
                                       System.out.println(" " + (h+1) + "\t\t" + guess1[h] + "\t\t" + guess2[h] + "\t\t" + time[h]);
                                  System.out.println("");
                                  System.out.println("Start guessing, it's a number between 1 and 1000...");
                                                                                               f=System.currentTimeMillis()/1000;////////////include this line here
                             count=0;
                   }

  • Again..What elapse time you are expecting for this query..

    Hi Again want to confirm with you Oracle gurus ...
    Does following plsql code really takes time in mins
    I do not used to deal with clob data so can not say why there is so delay..
    -> TableA has 3000 rows with text_data clob column holding large clob data...
    -> TableB has some thing which i wnat to append in text_data column..
    -> Trying to minimize elapse time..
    declare
    cursor c1 is select object_id from TableA where object_type = 'STDTEXT' and rownum < 1000;
    TYPE v_object_id_t is table of TableA.object_id%type index by binary_integer;
    v_object_id v_object_id_t;
    cursor c2(p_object_id TableA.object_id%type) is
    select to_clob('<IMG "MFI_7579(@CONTROL=' || ref_id || ',REF_ID=' || ref_id || ').@UDV">' || substr('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx',1, round(to_char(systimestamp,'FF2')/2)-1)) temp_data
    from TableB where object_id = p_object_id;
    TYPE v_text_data_t is table of TableA.text_data%type index by binary_integer;
    v_text_data v_text_data_t;
    v_temp clob ;
    r2 c2%rowtype;
    begin
    open c1;
    loop
    FETCH c1 BULK COLLECT INTO v_object_id ;
    for i in 1..v_object_id.count loop
    dbms_lob.createtemporary(v_temp,TRUE);
    open c2(v_object_id(i));
    loop
    fetch c2 into r2;
    exit when c2%NOTFOUND;
    dbms_lob.append(v_temp,r2.temp_data);
    end loop;
    close c2;
    v_text_data(i) := '';
    v_text_data(i) := v_temp;
    -- DBMS_OUTPUT.PUT_LINE (length(v_text_data(i)));
    dbms_lob.freetemporary(v_temp);
    end loop;
    forall counter in 1..v_text_data.count
    update TableA
    set text_data = concat(text_data,v_text_data(counter))
    where object_id = v_object_id(counter);
    DBMS_OUTPUT.PUT_LINE ('Update performed!');
    commit;
    EXIT WHEN c1%NOTFOUND;
    end loop;
    close c1;
    exception
    when others then
    DBMS_OUTPUT.PUT_LINE ('Update not performed!');
    end;
    -- Last elapse time 333 sec for 8k text_data data if i use 16k block size
    -- Last elapse time 1503 sec for 2k text_data data if i use 8k block size
    ->> Am I going rigth way???
    Please Help...
    Cheers :)
    Rushang Kansara
    Message was edited by:
    Rushang Kansara
    Message was edited by:
    Rushang Kansara

    Here is an example that shows SQL and PL/SQL methods. Note that the DBMS_LOB.WriteAppend() call is the wrong call to use (as I did above. The correct call to use (for appending CLOB to a CLOB) is DBMS_LOB.Append() (as shown below).
    SQL> create table my_docs
    2 (
    3 doc_id number,
    4 doc CLOB
    5 )
    6 /
    Table created.
    SQL>
    SQL> create sequence id
    2 start with 1
    3 increment by 1
    4 nomaxvalue
    5 /
    Sequence created.
    SQL>
    SQL>
    SQL> create or replace procedure AddXML( rowCount number DEFAULT 1000 ) is
    2 cursor curXML is
    3 select
    4 XMLElement( "ORA_OBJECT",
    5 XMLForest(
    6 object_id as "ID",
    7 owner as "OWNER",
    8 object_type as "TYPE",
    9 object_name as "NAME"
    10 )
    11 ) as "XML_DATA"
    12 from all_objects
    13 where rownum <= rowCount;
    14
    15 tmpClob CLOB;
    16 xml XMLType;
    17 lineCount number := 0;
    18 docID number;
    19 begin
    20 DBMS_LOB.CreateTemporary( tmpClob, TRUE );
    21
    22 open curXML;
    23 loop
    24 fetch curXML into xml;
    25 exit when curXML%NOTFOUND;
    26
    27 lineCount := lineCount + 1;
    28
    29 DBMS_LOB.Append(
    30 tmpClob,
    31 xml.GetCLOBVal() -- add the XML CLOB to our temp CLOB
    32 );
    33 end loop;
    34 close curXML;
    35
    36 insert
    37 into my_docs
    38 ( doc_id, doc )
    39 values
    40 ( id.NextVal, tmpClob )
    41 returning doc_id into docID;
    42
    43 commit;
    44
    45 DBMS_LOB.FreeTemporary( tmpClob );
    46 DBMS_OUTPUT.put_line( lineCount||' XML object(s) were appended to document '||docID );
    47 end;
    48 /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> -- add 3 CLOBs of varying sizes
    SQL> exec AddXML
    1000 XML object(s) were appended to document 1
    PL/SQL procedure successfully completed.
    SQL> exec AddXML(100)
    100 XML object(s) were appended to document 2
    PL/SQL procedure successfully completed.
    SQL> exec AddXML(500)
    500 XML object(s) were appended to document 3
    PL/SQL procedure successfully completed.
    SQL>
    SQL> -- what are the sizes of the CLOBs and the total size?
    SQL> select
    2 doc_id,
    3 SUM( ROUND( LENGTH(doc)/1024 ) ) as "KB_SIZE"
    4 from my_docs
    5 group by
    6 ROLLUP(doc_id)
    7 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    154
    SQL>
    SQL> -- add an empty CLOB
    SQL> insert into my_docs values( 0, NULL );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> -- note that the new CLOB is zero KB in size
    SQL> select
    2 doc_id,
    3 ROUND( LENGTH(doc)/1024 ) as "KB_SIZE"
    4 from my_docs
    5 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    0
    SQL>
    SQL> -- we add document 1 to 3 to document 0 using SQL
    SQL> update my_docs
    2 set doc = doc || (select t.doc from my_docs t where t.doc_id = 1 )
    3 where doc_id = 0;
    1 row updated.
    SQL>
    SQL> update my_docs
    2 set doc = doc || (select t.doc from my_docs t where t.doc_id = 2 )
    3 where doc_id = 0;
    1 row updated.
    SQL>
    SQL>
    SQL> update my_docs
    2 set doc = doc || (select t.doc from my_docs t where t.doc_id = 3 )
    3 where doc_id = 0;
    1 row updated.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> -- what are the sizes now?
    SQL> select
    2 doc_id,
    3 ROUND( LENGTH(doc)/1024 ) as "KB_SIZE"
    4 from my_docs
    5 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    0 154
    SQL>
    SQL>
    SQL> -- we do the adds again, but time time using a PL/SQL procedure to do it
    SQL> declare
    2 cursor c is
    3 select doc from my_docs where doc_id in (1,2,3);
    4
    5 updateClob CLOB;
    6 appendClob CLOB;
    7 begin
    8 -- we must lock the row for update and then we can write directly
    9 -- to that row's CLOB locator (without using the UPDATE SQL statement)
    10 select
    11 doc into updateClob
    12 from my_docs
    13 where doc_id = 0
    14 for update;
    15
    16
    17 open c;
    18 loop
    19 fetch c into appendClob;
    20 exit when c%NOTFOUND;
    21
    22 -- we append the CLOBs to document 0
    23 DBMS_LOB.Append( updateClob, appendClob );
    24 end loop;
    25
    26 -- .. and commit the changes to document 0's CLOB locator
    27 commit;
    28 end;
    29 /
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL> -- what are the sizes now?
    SQL> select
    2 doc_id,
    3 ROUND( LENGTH(doc)/1024 ) as "KB_SIZE"
    4 from my_docs
    5 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    0 308
    SQL>

  • Check Scan for NI435X and elapsed time doesn't run in loop

    Dear all Labview Experts
    i have 2 questions
    (1) i written program with Check Scan for NI435X (input to no of scan to NI 435X read ) and one with only NI435X read( to read in voltage) with constant input to no of  scan,
    the data i obtained is attached in 2 doucments; With Check Scan and without check scan ( the left column is temperature read in ( a formula is used to convert volt to temperature, right column is time)
    strangely the program with check scan shows values in negative ==> Voltage read in is 0, strange, why is this so??? and why is there a diff?? Hope u understand my question
    (2) For elapsed time, i want to find the total elapsed time for the whole program as well as individual cases,  there is no "running"  elapsed time or individual running time,
    what happen is that when the each case end, the time will jump (e.g. from 0 at start, it will change to 5.35 at end of case) , is there any where to make the time run, i need it because some case required
    c
    ondition such as case will move to next after 5 seconds, but if above case happen, the vi will only stop if i put >= 5 rather than just place = 5
    hope u understand,
    does it help if i placed the condition as another loop , will it mean the same things
    Attach are vi and some doucments, however as my vi contains PID tool kit as will as ni435x ni DC power which cannot be opened if you do
    not have these kits.......however mayb u can help to look at the portion of timing as this is the main problem i faced now.........
    Hope it is not too confusing for you to understand me...........
    i can only attach max 3, the next post i will attach 2 vis...........
    Attachments:
    Picture of check scan and without.rtf ‏15 KB
    With Check Scan.txt ‏4 KB
    Without Check Scan.txt ‏1 KB

    Thks Brian
    Attached are 3 VIs
    1.the first vi is the one with the check scan
    2. the next two vi the only diff is the placement of the where i put the elapsed time and time of each case.........(without check scan)--the first
    one is within the big loop, the other outside  big loop -- the purpose i did this is because when i run the vi with the timing in the big loop, the timing does not run continuously but "skip". for e.g. Denature time: from 0 . it jump to 5.15s without showing the running.............
    i will attached another 2 vi s in my next attachment
    Hope this clarifies a bit
    your help is really appreciated
    thks
    Attachments:
    PCR Control_State Machine_4 channel_Timing within Loop.vi ‏438 KB
    PCR Control_State Machine_4 channel_with_check scan.vi ‏443 KB
    PCR Control_State Machine_4 channel_Timing outside of loop.vi ‏442 KB

  • Creating a function with  a for loop and %type

    Hello,
    I am trying to create a function which contains a for loop as well as %type.
    This function is on a student table and i am trying to create a function which will display the zip which is a varchar2(5).
    I need to do this through this function.
    However, I can't seem to get it running.
    Can anyone help?
    below is what i tried as well as other options and was not successful.
    I also displayed my error with the show error command.
    SQL> create or replace function zip_exist
    2 return varchar2
    3 is
    4 v_zip student.zip%TYPE;
    5 cursor c_zip is
    6 select zip
    7 from
    8 student
    9 where zip=zip;
    10 begin
    11 open c_zip;
    12 v_zip IN c_zip
    13 loop
    14 v_zip:=c_zip%TYPE;
    15 end loop;
    16 close c_zip;
    17 end;
    18 /
    Warning: Function created with compilation errors.
    SQL> show error
    Errors for FUNCTION ZIP_EXIST:
    LINE/COL ERROR
    12/7 PLS-00103: Encountered the symbol "IN" when expecting one of the
    following:
    := . ( @ % ;
    16/1 PLS-00103: Encountered the symbol "CLOSE"
    SQL>
    kabrajo

    user10873577 wrote:
    Hello,
    I am trying to create a function which contains a for loop as well as %type.
    This function is on a student table and i am trying to create a function which will display the zip which is a varchar2(5).
    I need to do this through this function.
    However, I can't seem to get it running.
    Can anyone help?
    below is what i tried as well as other options and was not successful.
    I also displayed my error with the show error command.
    SQL> create or replace function zip_exist
    2 return varchar2
    3 is
    4 v_zip student.zip%TYPE;
    5 cursor c_zip is
    6 select zip
    7 from
    8 student
    9 where zip=zip;
    10 begin
    11 open c_zip;
    12 v_zip IN c_zip
    13 loop
    14 v_zip:=c_zip%TYPE;
    15 end loop;
    16 close c_zip;
    17 end;
    18 /
    Warning: Function created with compilation errors.
    SQL> show error
    Errors for FUNCTION ZIP_EXIST:
    LINE/COL ERROR
    12/7 PLS-00103: Encountered the symbol "IN" when expecting one of the
    following:
    := . ( @ % ;
    16/1 PLS-00103: Encountered the symbol "CLOSE"
    SQL>
    kabrajoTry This
    Create a sample table
    SQL> create table student(id number(10),zip varchar2(5));
    Table created.Insert the record
    SQL> insert into student values(1111,'A5454');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from student;
            ID ZIP
          1111 A5454
    SQL> create or replace function zip_exist(v_id number)
      2   return varchar2
      3   is
      4   v_zip student.zip%TYPE;
      5  BEGIN
      6   select zip
      7   INTO v_zip
      8   FROM student
      9   where id=v_id;
    10   Return v_zip;
    11  EXCEPTION WHEN NO_DATA_FOUND THEN
    12                  RETURN 'INVALD';
    13  WHEN OTHERS THEN
    14                 return  'NA!';
    15   end;
    16  /
    Function created.
    SQL> set serveroutput on
    SQL> select zip_exist(1111) from dual;
    ZIP_EXIST(1111)
    A5454
    SQL> select zip_exist(2222) from dual;
    ZIP_EXIST(2222)
    INVALDHope this helps
    Regards,
    Achyut K

  • Functions in a For Loop defining objects from an Array. . .Why Won't This Work?!

    I'm trying to put these functions into a Loop to conserve
    space. Why won't this work?
    .

    Yeah, sly one is right. You can not have the "i" inside the
    onRollOver function, what you have to do is: As the movieClip class
    is dynamic you can create a property of the movieClip which stores
    the value if the "i". And then, inside the onRollOver function, you
    have to make reference to that property.
    for (i=0; i<2; i++) {
    this.regArray
    .iterator = i;
    this.regArray.onRollOver = function () {
    showRegion(regArray[this.iterator]);
    this.regArray
    .onRollOut = function () {
    hideRegion(regArray[this.iterator]);

  • How can i reset elapsed time VI

    I am using the elapsed time express VI along with an "in range" comparison VI as the exit control for a torque test.  If the voltage signal from the torque transducer is within the specified range for the target time, the loop exits.  If the voltage signal is out of range, the elapsed time resets to zero.
    My problem arises when i exit the loop prematurely due to excessive torque.  Like if torque reaches the transducer limit, I want to exit the loop to prevent damage.  When i exit the loop like this, the elapsed time VI continues counting even though the loop has been stopped.  The next time the program enters the state, it exits immediately (because torque is initially zero, and the timer has passed the set time).  After that iteration the program behaves as i expect it to, because the VI has reinitialized I assume.  I have been stuck on this problem for several days, and I'm going to start breaking company computers if i can't fix it.
    So my question(s)... is there a way to reset the elapsed time VI upon entering the while loop?  is there a way to reset the VI from the 'torque limit' state immediately following the exit?  I also use a 'resume test' button so the user can restart the test after checking the unit,hardware,etc.  can i wire something to that button press to restart the elapsed time VI?
    My 7.1 vi is attached, the elapsed time problem being in the 'exercise' state.  immediately following an 'exercise' torque limit, it goes to the 'torque limit' state, which i thought could be used to reinitialize the elapsed time somehow. 
    Thanks,
    Evan
    Attachments:
    DB6483 Test.vi ‏2932 KB

    I have a similar problem ,
    I use a elapsed tiem function ,with a target of 1s time.
    i want to caluclate mean of samples in this 1 second
    but what i see i get 8-9 mean values in 1 second
    i also wired my i of while loop to auto reset with case structure,but even then i see so many average sample values in a second
    to be more precise i want data like this:
    when my DAQ board gives some 1000 samples per second. i need mean of these 1000 samples,but not all 1000 sanmples.
    for this i included a elapsed time vi with taget of 1s. (didnt forget to reset after 1s).
    but what i see is it gives values like this
    12:12:01     d1 d2 d3
    12:12:01     d1 d2 d3
    but i expect like
    12:12:01   d1 d2 d3
    12:12:02   d1:d2:d3
     did i go any where wrong in my Vi.
    how can get out of it!

  • Elapsed time to run subvi

    hi....
    first of all ..sorry if the subject title didn't match with my problem. I have no idea what is the suitable title should i put there.
    anyway my question is..how should i do to set every one hour i can run a subvi?for example i have a subvi that use to send a msg to the gsm card to delete all the read msg inside the simcard. so means that I want to delete all the messages every one hour. if i have delete the msg i will stop the subvi and wait for next hour to delete the message.
    anyone can help?..pls..hope that's all clear..
    thanks..

    Or you could use the Elapsed Time function wired to a case statement with you subVI inside that.

  • Multiple indicator from elapsed time

    Hello all,
    I need help in simplifying my block diagram. In my semII)timing.vi, i include multiple LED indicators that would light up on specific time. I've also included a time display to indicate the elapsed time. I've also included and On/Off light tht would turn red when the test time(6mins) has ended.
    But recenlty, i came across the Elapsed Time function as seen in the sem11)elapsed time.vi. I'm trying to incorporate that function, but it only allows one set timed.
    Could anyone suggest how i could include multiple controls, so multiple LEDs can light up at different times (at every mins)
    regards,
    beplusso.
    Attachments:
    semII) Timing.vi ‏45 KB
    semII) elapsed time.vi ‏38 KB

    Here's something that should at least give you the general idea. I don't know what version of LabVIEW you have, but these are in 8.2.
    I put the comparisons for your LED indicators into one vi, and the code that calculates the (m) and (cm) into another. In a simple program like this, they are not really necessary, but if your code were to grow (which it easily can) it might make things cleaner later on.
    Finally, you should always use labels for all of your controls and indicators. You can simply hide them if you don't want to see them on the front panel (right-click on the front panel item and select Visible Items - Label), and it makes wiring and debugging much easier.
    Good luck!
    Attachments:
    FieldIndicatorsBD.PNG ‏35 KB
    Field Indicators.zip ‏196 KB
    FieldIndicatorsFP.PNG ‏43 KB

  • Elapse timer

    Hi, 
    I am doing this motion sensor project. i have gotten it to work like when it senses a motion it will light up the boolean led. so now i am suppose to add a some sort of timer which some has recommended me elapsed time, i tried figuring out but i dont know how to wire it to my program. My task is to set a timer, so that when 10 mins has passed and no motion is detected it will trigger a logic 1 ( Digital Input ) to another program. But right now im focusing on this program as i need to integrate both. So how do i wire it to make it like how i had described. And lastly i need a reset button so that after it input a logic 1 ( which will trigger a alarm - another program ) it can be reset and countdown 10 mins again. Thankyou

    First, you should continue in your original thread.
    Next, take the LabVIEW tutorials. 
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours
    Then, read the help file for the Elapsed Time function.
    Finally, set up a simple VI where you can experiment with how that function works.
     

  • Direct Path Read waits are not showing in Elapsed time

    Hi,
    I'm having a question regarding interpretation of a SQL trace file. I'm on Oracle 11.2.0.1 HP/UX 64 bit.
    Following is only the overall result of the trace (it is quite big).
    My question is about the Direct Path Read waits which are totallizing 268s of wait but are not showing in the fetch elapsed time (49.58s) and are not showing anywhere in the trace except in the overall result.
    I do not understand why it is not part of the Elapsed time...
    For info, the trace is for the specific session that was performing all the required queries to display an online report. The database is accessed by the Java application using Hybernate.
    The trace was obtained by the following SQL:
    exec sys.dbms_monitor.serv_mod_act_trace_enable(service_name=>'SYS$USERS',waits=>true,binds=>true);Then I query the sessions to find the one created by the application.
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       36      0.43       0.51          0          5          0           0
    Execute     62      0.01       0.01          0          0          0           0
    Fetch      579      4.01      49.06       3027     153553          0        5516
    total      677      4.45      49.58       3027     153558          0        5516
    Misses in library cache during parse: 29
    Misses in library cache during execute: 2
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                   32754        0.00          0.03
      SQL*Net message from client                 32753        2.33        232.01
      Disk file operations I/O                      179        0.00          0.02
      db file sequential read                      2979        0.54         45.72
      SQL*Net more data to client                133563        0.04          5.30
      direct path read                            34840        0.94        268.21
      SQL*Net more data from client                1075        0.00          0.02
      db file scattered read                          6        0.03          0.11
      asynch descriptor resize                       52        0.00          0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       25      0.00       0.02          0          0          0           0
    Execute     58      0.05       0.04          0          0          0           0
    Fetch      126      0.00       0.04          4        161          0         123
    total      209      0.05       0.11          4        161          0         123
    Misses in library cache during parse: 3
    Misses in library cache during execute: 3
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      Disk file operations I/O                        1        0.00          0.00
      db file sequential read                         4        0.01          0.03
      asynch descriptor resize                        1        0.00          0.00
       37  user  SQL statements in session.
       57  internal SQL statements in session.
       94  SQL statements in session.
    Trace file: oxd1ta00_ora_16542.trc
    Trace file compatibility: 11.1.0.7
    Sort options: default
           1  session in tracefile.
          37  user  SQL statements in trace file.
          57  internal SQL statements in trace file.
          94  SQL statements in trace file.
          57  unique SQL statements in trace file.
      241517  lines in trace file.
         568  elapsed seconds in trace file.Thanks
    Christophe

    Christophe Lize wrote:
    Closing this thread even if it's not answered...Sorry, I don't have time to test this myself now, but you shouldn't mark this thread as answered if it is not, because other people might find it and think they find an answer if they have a similar question.
    I suggest you try the following to narrow down things:
    1. Open the RAW trace file and check the cursor numbers of the "direct path reads" - check if you can find any references for those cursor numbers manually. The cursor numbers are those numbers behind the WAIT #<xx>, and you can check if you find any other entry unequal to WAIT #<xx> with the same #<xx>, for example EXEC #<xx> or FETCH #<xx>
    A short primer on how to interpret the raw trace file can also be found in MOS document 39817.1
    2. Run the RAW trace file through alternative free trace file analyzers like SQLDeveloper (yes it can process raw trace files), OraSRP or Christian Antognini's TVD$XTAT. If you have My Oracle Support access you can also try Oracle's own extended Trace Analyzer (TRCA / TRCANLZR). See MOS Note 224270.1
    Check if these tools tell you more about your specific wait event and oddities with the trace file in general.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    Co-author of the "OakTable Expert Oracle Practices" book:
    http://www.apress.com/book/view/1430226684
    http://www.amazon.com/Expert-Oracle-Practices-Database-Administration/dp/1430226684

  • How to define function within for loop pls help?????

    Hi this is the problem i have a class, and within that class there is an actionPerformed function, in this class i also create an instance of another class, this other class also contains an actionPerformed function, which wis executed if a jButton has been pressed, when I try to place this actionPerfromed function within a for loop of a function i get an error saying illegal start of experssion, and that the class should be defined abstract as it does not define actionPerformed, when i take it out of the for loop it compliles fine, i need the function to be placed within the for loop because it needs to know the variable of the for loop, is there anyway around this? Thanks, below is the code:
    public class DisplayTransitions extends JFrame implements ActionListener
    public void add()
    for(int i = 0; i < char2.size(); i ++)
    mPanel.add(tim[i] = new JButton("Time"));
    tim.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
         if (ae.getSource() == tim[i])
              timeIncr();

    This is your for loop using an anonymous inner class for the listener:
                for (int i = 0; i < char2.size(); i++) {
                    mPanel.add(tim[i] = new JButton("Time"));
                    tim.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    if (ae.getSource() == tim[i]) {
    timeIncr();
    Learn more about anonymous inner classes from a good Java book or the Java tutorial (try http://java.sun.com/docs/books/tutorial/java/javaOO/QandE/nested-answers.html).

  • Date Utility - calc age, elapsed time...

    I need to calculate elapsed time between 2 dates, for example calc age based on DOB and Today. There must be a utility out there somewhere (free!). I'm sure I'm not the first one with this requirement.

    try this
    import java.util.*;
    public class DateSub {
      public static void main(String [] args) {
        Calendar cal = Calendar.getInstance();
        cal.set (1970,0,1);
        long age = cal.getTime().getTime();
        age = System.currentTimeMillis() - age;
        System.out.println ("age = " + age + " milliseconds" );
        age /= 1000;
        System.out.println ("age = " + age + " seconds" );
        age /= (3600*24);
        System.out.println ("age = " + age + " days" );
        long years = age/(365);
        long days = age % 365;
        System.out.println ("age = " + years + " years " + days + " days");
    }

Maybe you are looking for

  • New MBP -- Wireless Connectivity Inconsistent (Despite MBP's Claims)

    Have a new MBP, running 10.5.6 straight out of the box. All essential system updates have been downloaded and installed (one FCE update remains undownloaded). The Airport connection is tenuous -- it will stay connected to the internet for hours at a

  • Problem in delivery of sales order

    dear sdn, i have sucessfully create my sales order but problem arise while doing delivery the error is  @5D\QWarning@     10457     10     "No schedule lines due for delivery up to the selected date"     @35\QLong text exists@ help me out the date is

  • Itunes syncing problem...HELP!

    Hello! I've got a REALLY annoying problem with my iPhone currently, out of nowhere it is crashing when syncing on step 2 the backup stage, I've looked through possible suggestions, tried numerous things but cant find a solution! Any ideas!?

  • Trying to restore the software locks up the iphone and renders it unusable

    Trying to restore the software locks up the iphone and renders it unusable

  • Printer for LR 3.2

    I am looking at a new printer and want to make sure there are no glitches with LR 3.2 thinking about: Canon pro9000 mark II epson stylus 1400 I want to be able to print 13 x 19.  any other suggestions that are great printers + easy to use and under $