How to stop a elapse time

Hi,
I have an elapsed time inside a while loop and I want stop it (the elapsed time) when the user press a button.
How can I do it?
Thanks,
ToNi.

Here is a vi that I created for demonstration of how to keep track of running time with the ability to pause and continue by pressing a switch. Perhaps you will find it useful and can modify it, or use some of the code in your vi. If you want to control the pause and continue from another vi, you will have to pass the reference of the pause switch to this vi, and change this vi to use the reference instead of an actual pause switch. Hope this helps.
- tbob
Inventor of the WORM Global
Attachments:
PauseTimer.vi ‏41 KB

Similar Messages

  • How to stop the "Elapsed Time" counting without stop the program running?

    我使用Labview 8.2,配合USB DAQ來做測試治具。目的:
    當檢測到某個電壓(Analog Input)到達某個電壓值(5V)之後,開始啟動計時。若是在15秒之內,另一個電壓值降為0之後為正常​,此時停止計時(但是數值不能歸零);若是超過15秒還沒有降到0伏,則表示錯誤,此時亮起紅色 indicator警示,但是時間仍然繼續計時,直到電壓降到0為止才停(但是數值不能歸零)。
    我使用 Elapsed Time 模組來使用,可是問題是如何讓該模組停止計時同時不能將時間歸零?因為此模組只有 "Reset" 控制功能,一但將條件結果輸入到 Reset input 之後,電壓達到零之後就會將此 Elapsed Time 歸零了。有沒有解決辦法?

    Elapsed Time 確實會將時間reset,如果你想要保留時間的話其實有很多做法
    例如使用 tick count,他會顯示出相對時間數值,先放一個tick count在迴圈開始前
    記得用sequence以確保他會在回區尚未開始運作前先記錄時間
    然後再放一個tick count在迴圈內,再用case或select讓電壓等於零時記錄下tick count的值
    再將兩者相減即可
    Chris

  • How to display the elapsed time of a video (event video) in Captivate 6

    I have a Captivate 6 project which includes two separate videos and I am wondering how I can display an elapsed time for the videos - preferably one that stops if the individual stops the video.

    Hello and welcome to the forum,
    Are you talking about an inserted video, or about the Captivate file itself? I'm asking this because a lot of users refer to a published CP-file as a video.
    'Elapsed time': is this the real time spent by the user, or the time as you can see in the TOC (developer's time)? I blogged once about the difference.
    Lilybiri

  • 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!

  • How to stop the java timer

    I tried writing a program for a scheduler using java , compiled and ran in java 1.6 .The code is given below
    import java.util.*;
    public class TimerTaskEx2 {
         public static void main(String[] args) {
              Timer timer = new Timer();
              timer.scheduleAtFixedRate(new TimerTask(){
                   public void run() {
                        System.out.println("Java");
              }, 5000, 1000);
    output
    Java
    Java
    Java
    Java
    Java
    Java
    Java
    The output of this program starts after 5 milliseconds delay and keeps running infinitely becoz the program is written only in such a way .
    but my actual requirement is the timer should start 5 milliseconds after i run the program and stop after 20 milliseconds .
    Here I need to know how to stop it at a required time interval
    I dont find any api regarding this in 1.6 spec .
    please clarify how to do that .
    Thanks
    Jee

    try this code:
    import java.util.*;
    public class TimerTaskEx2 {
         public static void main(String[] args) {
              Timer timer = new Timer();
              timer.scheduleAtFixedRate(new TimerTask() {
                   int i = 0;               
                   public void run() {
                        System.out.println("Java");
                        i++;
                        if (i > 3)
                             this.cancel();                    
              }, 5000, 1000);
    Also, make sure to close the alive thread too.

  • How to reduce the elapsed time on this query.

    Oracle10.2.0.5 on AIX6.1.
    Here is the awrsql report of a query for a one hour window.
    Here UNBILLED has 120million records which is partitioned and subpartitioned. It has 10 partitions and 312 subpartitions. One subpartition has 10M records, 10 others have 1M each and 270 subpartitions have 360K records each. And 31 subpartitions are empty.
    And BILLED has 300K records.
    Looking at report you can see that out of 984 seconds, 958 is used for IO. Machine is PowerPC_POWER5 with 8CPU and disk storage on EMC.
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                           984,327        5,561.2    28.6
    CPU Time (ms)                                40,760          230.3    29.8
    Executions                                      177            N/A     N/A
    Buffer Gets                               1,923,456       10,867.0    46.9
    Disk Reads                                  203,832        1,151.6    25.1
    Parse Calls                                       0            0.0     0.0
    Rows                                        106,200          600.0     N/A
    User I/O Wait Time (ms)                     958,766            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     1            N/A     N/A
    Sharable Mem(KB)                                 31            N/A     N/A
    SQL_ID akg45a750sh0u
    DELETE UNBILLED WHERE (MSG_ID, MSG_ID2,SPLIT_ROW_NUM) IN (SELECT MSG_ID,MSG_ID2, SPLIT_ROW_NUM FROM BILLED
    WHERE BILL_REF_NO = :B2 AND BILL_REF_RESETS = :B1 )
    Plan hash value: 3879210699
    | Id  | Operation                            | Name                          | Rows  | Bytes | Cost (%CPU)| Pstart| Pstop |
    |   0 | DELETE STATEMENT                     |                               |       |       |     1 (100)|       |       |
    |   1 |  DELETE                              | UNBILLED                      |       |       |            |       |       |
    |   2 |   NESTED LOOPS                       |                               |     1 |   112 |     0   (0)|       |       |
    |   3 |    TABLE ACCESS BY GLOBAL INDEX ROWID| BILLED                        |     1 |    65 |     0   (0)|     1 |     1 |
    |   4 |     INDEX RANGE SCAN                 | BILLED_XCB_BILL_REF_TRANS     |     1 |       |     0   (0)|       |       |
    |   5 |    INDEX UNIQUE SCAN                 | UNBILLED_PK                   |     1 |    47 |     0   (0)|       |       |
    ----------------------------------------------------------------------------------------------------------------------Is there way to improve the elapsed time( currently 5,561.2 msec per execution) of the query?
    Thanks for your time...

    user1014212 wrote:
    You're giving very interresting pointers.. Especially the one using the GTT table... Thanks...
    I was also looking from a DBA point of view, say increasing the DB_CACHE_SIZE from 5GB to 8GB as the machine has almost 32GB memory out of which 13GB is free memory. Because the timed event is "db file sequential read" which takes 95% of Total Call time.
    select * from V_$SGA_TARGET_ADVICE;
    post SQL & FORMATTED results using tags                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to find the elapsed time between 2 events ?

    I want to use the robot class and I have register all events in a file but when I use the Robot. It isn't synchronous. So I should find th elapsed time between two events for reproducing them with the method delay of the class Robot.
    Thanks

    It sounds like you want to reproduce the events with varying time between the events? This is a good idea for a couple of reasons 1) it's possible to enqueue events so quickly that Robot gets ahead of the Java GUI, and 2) every human does their mouse/keyboard activity at varying (and relatively slow, relative to the computer that is) rates of speed. It would help make a more realistic interaction to vary the speed of event reproduction.
    Since you can't control the amount of time between the call to Robot and when the event arrives in the application, you can't be ultimately precise about this. You'll have to accept a teensy bit of slop in the process and just live with it.
    That is ... you can do something like robot.method1() .. Thread.sleep(1) .. robot.method2() .. Thread.sleep(1) ... and that will give slight delays. If you vary the value for Thread.sleep you can vary the event reproduction speed. Early in the development of Robot I experimented with something like this - I set up an EventQueue listener to capture all mouse/keyboard events (remember that each comes with a timestamp) and then reproduced events using the time intervals from the captured events to control the Thread.sleep times between Robot calls. It worked pretty well, and the mouse would dance around in the same way I moved the mouse around.
    - David

  • How to get one elapsed time for two loops OR MORE

    I'm calculating the time spent to maintain a value "elapsed time" for 2 things(A and B) differents,what to change in order to have 1 "elapsed time" not 2 ,so the value of "elapsed time" is caculated the moment the user maintain the value of A and B
    Attachments:
    item n4 complet.vi ‏3850 KB

    My VI is already attached
    Elapsed time 2 is calculated when the user starts the test of "variometre",maintien 3 when the user keeps the pointer of the variometre in 7 for 10 seconds
    Elapsed time  is calculated when the user starts the test of"horizon artificiel",maintien 2 when the user keeps the pointer of the horizon in 30 for 10 seconds.
    that's good if i wanna each test alone,but now the complication of this one is to maintain the 2 values 7 of the variometre and 30 of the horizon in the same time during 10 secs.that's why i want to have just 1 elapsed time and 1 maintien,because the the 2 tests will run on parallel then the elapsed time must start and when the user realises the 2 conditions in the same time,the maintien must begin counting.
    Attachments:
    item n4 complet.vi ‏3850 KB

  • How to stop the sla time of a service ticket

    Hello Folks,
    Is there a way to stop or pause the sla counting time of a service ticket?
    I have a scenario, where I get a service ticket, and I have to stop the sla counting time, because I need a response from a third person, not involved at that time.
    I´m using webclient, and my guess, is, there something realted to status, sla and actions, but not sure about.
    Could somebody give me some advise or a clue about it?
    Answers will be rewarded.
    thanks in advance,
    Luiz David

    Hi Luiz,
    Status needs to be selected in the conditions. Follow the below steps
    1. Select the actions in conditons
    Goto   Spro -->  IMG --> CRM --> Action --> Actions in transactions --> Change actions and conditions  --> Define conditions
    and click on your action profile and open the action
    2. Go to the start conditions tab and click on the edit conditions
    3. Click on the condition definition space and expand the container in the change condition pop-up box
    4. Double click on the status table and choose the new user status in the constant field
    5. Select the operator as not equal to
    Hope it helps
    Regards,
    Madhu

  • How can I view elapsed time while viewing a clip in iMovie?

    When viewing a clip is there a way to see the elpased time in iMovie?

    Are you actually running Tiger OS 10.4.11?
    Which version of iMovie?

  • Elapsed Timer in secs

    Hello,
    I would like to continuously update the elapsed timer indicator every second.  I do not understand why the program is not working?  Can you offer some assistance to help me display the elaspsed time (in seconds).  
    Thanks,
    hiNi.
    P.S. I know that there is an elapsed timer express VI, but I would like to know how to show the elapsed time without the express VI. THANKS!
    Solved!
    Go to Solution.
    Attachments:
    Elapsed Timer.llb ‏27 KB

    Why every second?  Why not with each iteration of your loop?
    Since your loop iterates every 100ms, you could make a counter using another shift register.  When the counter reaches 10, get your elaspsed time.
    Give these VIs a try to see if they do what you want.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Elapsed Timer.llb ‏23 KB

  • How to stop a while loop after certain time using Elapsed time vi

    how to stop a while loop after certain time using Elapsed time vi.

    Hi Frankie,
    Just place the Elapsed Time VI inside the WHILE loop, and wire the 'Time Has Elapsed' output to the conditional terminal in the lower right corner (which should be set to 'stop if true' by default).
    In the future, please post your LabVIEW questions to the LabVIEW Forum.  You have a much better chance of getting your questions answered sooner, and those answers can then help others who are searching the LabVIEW forums.  Thanks!
    Justin M
    National Instruments

  • Starting and stopping Elapsed Time

    I have some code in LabVIEW 8.2.1 I am writing for Qual test with a customer. The basics of the test are the following: monitor and record pressure (thru transducers), temperatures (fluid and ambient), and monitor the opening and closing a valve. The valve has two light switches orientated in such a way, that mechanical counters will count a cycle when it is fully closed to open to closed.
    The problem I am having, is that I need the elapsed time vi to start counting, once it has moved off of the full open switch. It needs to count to 240 seconds, at which time it will pass on to an on bit, which will energize the valve again. I can get it to start running at the right part, but it will stop once
    it gets in between the two light switches. It almost seems like the elapsed time vi doesn't have enough flexibility for what I need. That or I need to write a bunch of code that would enable it to do what I want.
    I am not sure on how I can post code so it can be viewed in LabVIEW, so here is a word doc.
    Attachments:
    elapsed timing vi.doc ‏45 KB

    Hello Chadius, 
    Thanks for posting,
    I took a look at your code this morning. We at NI recommend using varibales as one of the last resources when trying to pass data out in cases where this is rseally necesary, when looking at your code I realized that the variables to pass data are not needed and that actually there are some misconceptions about the functionality of the vi funtions, do not be ashamed that is totally understandable when you are new to a concept and more understandable if you are new to labVIEW.
    Before proceeding with the code I would like to encourage you to check the Getting started with LV It gives you the basis to start programming in labVIEW and helps us understand better how LV executes.
    There is also a lot of good help loaded in Labview that can help us determine what to use and what is expected of each function, you can access this by pressing ""CTRL+H" and accesing the detailed help when hovering over a specific VI and clicking detailed help.
    Then if you are a new user to labview and would likely use labview for long term development I will suggest the training.
    Now, getting to your code I can see that you are doing a bit more code than what you actually need, so for instance:
    -we can eliminate the constants and the selector and just pass the boolean.
    -we can also use less while loops so the part where you write to the variables can be done in the same while loop on the right.
    -Instead writing to the variable and reading from that same variable you can just wire a cable so you have the same data
    -You can use the error wire out/in of the functions to control code execution.
    Last but not least, I am asumming here that this application you are coding is most likely to be a state machine where you are making a choice depending of the inputs you have, If "A" then "B"
    This is an example of a simple state machine based on user input, you can change that input to be an event, a trigger etc.
    Hope this helps, 
    Luis
    Application Engineer
    National Instruments. 
    Attachments:
    LV_Getting_Started.pdf ‏918 KB
    This way looks better.JPG ‏20 KB
    Delete constants pass only bbolean.JPG ‏15 KB

  • How to get elapsed time in case struture?

    I'm trying to get Elapsed Time VI to work but couldn't figure out how to use it properly.
    I have a subVI with state machine structure to decode data stream from serial port.
    State1 uses VISA read to read a byte and check if it is the Start of Frame. If TRUE, goes to State2. If FALSE, loop back to State1 and try again.
    If the State1 keeps getting FALSE for certain time (e.g. 5 seconds), stop the subVI and insert custom error code.
    So I have to calculate the elapsed time since State1 starts to be FALSE and keeps to be FALSE.
    I tried to use Elapsed Time VI but have problem of understanding it well.
    Is there any other better solution than using Elapsed Time VI? Also, how long is the execution time of Elapsed Time VI?
    Any suggestion will be very much appreciated.

    Hi,
    The Boolean output (Time Elapsed) in Elapse Time VI should give True when time got elapsed.
    Else we can simulate using "Tick Count (ms)", which counts the ticks in milisecond. You can move on to state 2 when count reaches to reauired duration.
    We can give you better idea if you post the code VI.
    Regards
    Haneef

  • How can I see the elapsed time on imported video?

    I'm trying to make a video in iMovie 11'.  I would like to be able to view the elapsing time of the song I imported so I can match video footage with audio.  With the older version of iMovie, I could see a time clock on the bottom of the video I was importing, so I could match the mouth to the lyrics. 
    In the older iMovie version, the entire audio would play when only part of the clips had been imported by me.  Now with this version, the song stops playing when the clips stop.  So partial completion of the video, doesn't allow a full time clock of the total song to allow me to match the voice on the audio with the film of someone singing.
    In short, I can't find the running time clock for the video player in the project library.
    Can you help me with thsi?  The help menu has not anweered my questions.
    Thanks.
    Dave Demoise

    I agree with Bengt W. There are many reasons, even in a simple movie, to want to know the timing of things. This is a surprisingly frustrating product. For want of timing information, you are requiring your users to pay $300?
    In my situation, I took some video of a show (with the performers permission) with an iPad and an iPod.  All I want to do is make a movie with one video as the main position with a series of cutaway clips from the other. It is incredibly frustrating to do this without knowing where you are within each clip.
    When helpful and capable forum participants like we have here have to spend time explaining how best to make do with a product, it's a clear indication of a fault with the product. Now, I either have to spend extra time in iMovie making due with this crippled interface, or I have to spend time looking for an alternative product.
    Consider this a feature request!

Maybe you are looking for

  • "No such file or directory" errors on Time Machine backup volume

    I remotely mounted the Time Machine backup volume onto another Mac and was looking around it in a Terminal window and discovered what appeared to be a funny problem. If I "cd" into some folders (but not all) and do a "ls -la" command, I get a lot of

  • Purchase returns/sales invoice

    Dear all, When i do Purchase Returns - They are appearing as Sales invoices in sales (as well as in register) in the same regular sales invoice series. Why this is happening? please suggest.

  • SOAP  - XI - SOAP Error

    Hi, I am working on a scenario where a SOAP Client ( XMLSPY) sends a request to XI and XI forwards it to a web service and returns the result back to Soap Client. I am using SOAP Adapter at outbound and inbound.  I have done the following steps: 1. i

  • Different versions of Camera Raw launch from Bridge

    I'm running Mac OS X 10.6.8, Bridge CS 4 (3.0.0.464), Camera Raw 5.0, PSE8, and using a Nikon D5000. I have .jpg files and .nef files. From Bridge I double click on a .nef file and Camera Raw launches - but with limited options (only three tabs for e

  • Oracle RAC on Solarais Configuration Issue

    Hi, We are trying to install Oracle RAC 10g R2 on Solaris 10. Following are the products 1=> Soalris 10 OS 2=> Sun Cluster 3.1 3=> Veritas Volume Manager 4=> Veritas Cluster File System Can i deploy Oracle RAC using the above listed Software. Here we