How to measure time intervals

Hello!
I am sorry to bother this forum, but I haven't
found any faq for this group at faqs.org. Here is
my problem:
I have received a computer with LabView installed
and 2 DAQ cards (unfortunatelly, with no books).
I have built a program wich does few simple
tasks - it measures temerature from 4 different
channels at 100 measures/sec, plots it and writes
it to a file. I use 4 "AI aquire wavform"
instruments and not 1 multiple instrument. Now, I
would like to measure somehow the actual
intervals between the measures, if possible,
relative to the time that I press the start
button. I was not able to find how to do it, and
I would appreciate any help. Thank you
P.S. I would be very thankful if the cc of the
answer (if there
is one) will be sent to my e-
mail - I do not always have access to the
usegroups.
Sent via Deja.com http://www.deja.com/
Before you buy.

Ok.. try this code...
DATA : t1 TYPE i,
t2 TYPE i,
delta(16) TYPE p.
GET RUN TIME FIELD t1.
PERFORM get_data. "your block of code
GET RUN TIME FIELD t2.
delta = t2 - t1.
delta = delta / 1000000.
WRITE :/ 'Time elapsed : ', delta , 'Secs'. "time in secs.

Similar Messages

  • How to Measure time taken for a some lines of code in a program?

    Hi
    I have one requirement to measure time taken for executing a  block of code in report . How we can find it ?
    Is there any way to code something in report to caluculate it ?
    Please send solution as early as possible
    thank u

    Ok.. try this code...
    DATA : t1 TYPE i,
    t2 TYPE i,
    delta(16) TYPE p.
    GET RUN TIME FIELD t1.
    PERFORM get_data. "your block of code
    GET RUN TIME FIELD t2.
    delta = t2 - t1.
    delta = delta / 1000000.
    WRITE :/ 'Time elapsed : ', delta , 'Secs'. "time in secs.

  • How to specify time intervals as Pm to am

    User want to specify time intervals as 8 Pm to 8 am.
    In selction option
    he is Populating from  with 8 pm
    and to with 8 am.
    he want alll the entries from  8pm to 8 am, iam getting error as "Lower limit is higher than upper limit"
    how to solve this.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Jan 23, 2008 5:34 PM

    Well, you need to take the date into consideration as well.
    Rob

  • How to measure time in labview?

    Hello,
    I am using PCI-DAS card for Analog Input and Digital Output.
    In the Analog Input for the voltage measurement labview takes near
    about 1 second.But i want to reduce that time...means it has to take
    one reading only in some miliseconds and there is no loops nothing
    complicated just simple functions r there and as i run the vi it shows
    one voltage reading.
    I dont know how to reduce time period in this case.
    And another thing is that i am saying this 1 second as per my
    watch.but i want Labview itself shows the total time taken for the
    execution.
    Anybody knows about it please mail me and post the answer.
    Thanking You
    Safdar...

    In general AI, attached example should work (i.e. 6025E).
    This is however, an example for your reference only.
    Best regards
    ian
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    example_AI_20041110.vi ‏51 KB

  • How to measure time delayed measurement

    Hi All:
    I am using TDS3064 scope to measure time delay betwwen two channels (using IVI driver
    complience package 2.2 for scope IVI driver). I look through drivers, but not able to find
    delayed measurement function. Is there any alternate way to measure time delay betwwen two
    channels. If possible please provide me example. I am new to LV programming.
    Thanks
    DBhagat

    You have to understand something about IVI class drivers. To support portability, those functions that are common to a class are what you see in the driver. Some scopes might have the ability to measure time delay between trigger points on different waveforms but many don't. If there is such a function supported by your scope, then you can make a call to the instrument specific driver or a VISA Write/Read. Of course, you then loose the portability feature of IVI which, imho, is about the only reason to use IVI class drivers. What I would recomend is that you do a capture of both traces and then do an analysis of the raw data in LabVIEW. One way to do this is with Trigger Detection for 1 Channel (Analyze>Waveform Monitoring palette). Wire each channels data to the function and obtain the time for each trigger event. The function will return the time for each event that you can use to calculate the difference.

  • How to set timer intervals for object + and a motion for entering stage

    Hi, I am making a simple game but I have a couple problems/queries.
    1) My game is a touch an object and you get a point game, currently the objects appear randomly over the screen, however I am trying to get it to slide into the screen similar to the Fruit Ninja game, but not limited to entering from one side, does anyone know how to set this?
    2) As I mentioned above my objects appear randomly, I have set a timer when I change the timer from 800 to another number, it just makes all the objects on the screen last for 800 milliseconds all at the same time then disappear and appear somewhere else on the screen for another 800 milliseconds and it repeats, what I am trying to do is make them come at different intervals, for example:
    Object 1 - constantly appears, so when the 800 millisecond is over, it comes back on a different part of the stage
    Object 2 - I want it to appear every 5 seconds, so when the 800 millisecond is over it will come back on the stage in 5 seconds, but not instantly like Object 1
    But I have no idea how to do this :/ anyone have the code needed for me to do this?
    Sorry for the long questions, I only asked because I really am stuck, I have been trying to do this for over 2 weeks now.
    Thanks very much.
    My Code
    [Code]
    //importing tween classes
    import fl.transitions.easing.*;
    import fl.transitions.Tween;
    import flash.utils.Timer;
    //hiding the cursor
    Mouse.hide();
    var count:Number = 60;
    var myTimer:Timer = new Timer(1000,count);
    myTimer.addEventListener(TimerEvent.TIMER, countdown);
    myTimer.start();
    function countdown(event:TimerEvent):void {
    myText_txt.text = String((count)-myTimer.currentCount);
    if(myText_txt.text == "0"){
    gotoAndStop(5)
    //creating a new Star instance;
    var star:Star = new Star();
    var box:Box = new Box();
    var bomb:Bomb = new Bomb();
    //creating the timer
    var timer:Timer = new Timer(800);
    var timerbox:Timer = new Timer(850);
    var timerbomb:Timer = new Timer(1000);
    //we create variables for random X and Y positions
    var randomX:Number;
    var randomY:Number;
    //variable for the alpha tween effect
    var tween:Tween;
    //we check if a star instance is already added to the stage
    var starAdded:Boolean = false;
    var boxAdded:Boolean = false;
    var bombAdded:Boolean = false;
    //we count the points
    var points:int = 0;
    //adding event handler to the timer;
    timer.addEventListener(TimerEvent.TIMER, timerHandler);
    //starting the timer;
    timer.start();
    function timerHandler(e:TimerEvent):void
              //first we need to remove the star from the stage if already added
              if (starAdded)
                        removeChild(star);
              if (boxAdded)
                        removeChild(box);
              if (bombAdded)
                        removeChild(bomb);
              //positioning the star on a random position
              randomX = Math.random() * 800;
              randomY = Math.random() * 1280;
              star.x = randomX;
              star.y = randomY;
              star.rotation = Math.random() * 360;
              box.x = Math.random() * stage.stageWidth;
              box.y = Math.random() * stage.stageHeight;
              box.rotation = Math.random() * 360;
              bomb.x = Math.random() * stage.stageWidth;
              bomb.y = Math.random() * stage.stageHeight;
              bomb.rotation = Math.random() * 360;
              //adding the star to the stage
              addChild(star);
              addChild(box);
              addChild(bomb);
              //changing our boolean value to true
              starAdded = true;
              boxAdded = true;
              bombAdded = true;
              //adding a mouse click handler to the star
              star.addEventListener(MouseEvent.CLICK, clickHandler);
              box.addEventListener(MouseEvent.CLICK, clickHandlerr);
              bomb.addEventListener(MouseEvent.CLICK, clickHandlerrr);
    function clickHandlerr(e:Event):void
              //when we click/shoot a star we increment the points
              points +=  5;
              //showing the result in the text field
              points_txt.text = points.toString();
                        if (boxAdded)
                        removeChild(box);
              boxAdded = false;
    function clickHandler(e:Event):void
              //when we click/shoot a star we increment the points
              points++;
              //showing the result in the text field
              points_txt.text = points.toString();
              if (starAdded)
                        removeChild(star);
              starAdded = false;
    function clickHandlerrr(e:Event):void
              gotoAndPlay(5);
    [/Code]

    The only thing that affects TopLink is the increment by, as increasing this is what allows TopLink to reduce the number of times it needs to go to the database to get additional numbers. Ie, an increment value of 1 means TopLink needs to go the database after each insert; an increment value of 50 allows it to insert 50 times before having to get a value from the sequence. The cache on the sequence object in the database affect the database access times. While it may improve the access times when the sequence number is obtained from the database, but I believe the network access to obtain the sequence is the greater concern and slow down for most applications. It all depends on the application usage and design though - an increment (and application cache) of 50 numbers seems to be the best default.
    I cannot say what effect the cache vs nocache settings will have on your application, as it will depend on the database load. Only performance testing and tuning will truly be able to tell you whats best for your application.
    Best Regards,
    Chris

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • How to measure time spent on socket read() method ?

    Hi,
    I have a socket waiting for input stream from a remote host :
    // method blocks until some input is available
    int count = socket_host.getInputStream().read(bytes);
    I want to know how much time it took to receive "count" bytes from remote host.
              t1 = System.nanoTime();
              int count = socket_host.getInputStream().read(bytes);
              t2 = System.nanoTime();
    (t2-t1) of course is not the answer, because t1 needs to start when read method actually stop waiting..
    I need some kind of call back, in order to know when input starts coming..
    how would you do that accuratly ?
    thanks for help !!

    thanks ejp , I followed your idea :
         count1=socket_host.getInputStream().read(bytes,0,1);
         t1 = System.nanoTime();
         count2=socket_host.getInputStream().read(bytes,1,bytes.length-1);
         t2 = System.nanoTime();
         if (count1==1 && count2>0)
              count=count2+1;
         else if (count1==-1 || count2==-1)
              count=-1;After I compute speed (with t2-t1 and count given to that method)
         public static double computeSpeed(double nanosec,double nbbytes){
              if (nanosec==0)
                   return 0;
              double speedkilobytespersec=nbbytes/nanosec*1000000;
              return speedkilobytespersec;
         }But speed results are very erratic and sometimes superior to 100 MBytes /sec , which is not possible with my connection.
    Somehow, I have the feeling that when t1 is triggered, it is already too late, many bytes are already arrived, and results is not accurate.
    It would need a lower level trigger, wouldn't it ?
    thanks

  • How to measure time?

    how can i mesaure the time that took to execute a function?
    thanks

    how can i mesaure the time that took to execute a
    function?
    thanks
    Usually the end time minus the start time. How do you think? This probably won't tell you much though.

  • How to measure time difference between two continous encoder pulse (PULSE A & PULSE B)

    im trying to figure out the time difference between two square
    wave pulse (PULSE A and PULSE B) from an encoder. I tried to modify many code but fail to capture thephase difference  for each pulse. the
    pulse only rise to 5V and fall to 0V like normal square wave pulse
    can you and all of experts here help me out with this?
    my problem
    1) Encoder pulse are continous (pulse A and pulse B)
    2) Square wave pulse have "0V" and "5V" please rapidly
    if possible someone show me correct method , Im using LABVIEW 7.1 and Hardware NI SCOPE (PCI 5102)
    your advice are highly appreciated
    among my idea as in attachment , but I failed to get it
    Attachments:
    Need to Get this wave.JPG ‏34 KB

    Hi Amirul,
    Check the attached JPG file. i think this will be use full to you
    Regards,
    Santhosh M

  • How to run an "Automator" application at regular time intervals

    I would like to find out how to run an "Automator" application at regular time intervals, say at every 5 minutes.
    Is there any program, AppleScript or any method to do this?
    I would very much appreciate a help.
    Suwan

    save your workflow as an ical plugin, this will automatically insert the workflow into ical,and create a workflow category for it, then just set to repeat every 5 minutes, or save as an APP and use a program called CRONIX (freeware) to run the schedule.

  • How to read from DAQ in different time intervals

    Hello,
    I am currently using LabVIEW 2010. I am new to LabView.
    I have 9 thermocouples I want to record the temperature from and create a graph.
    For one graph I want to graph the data every second for the duration of about 1.25 hours. For the other I want to record and graph the data every 2 minutes for a duration of 30 minutes. The temperature then would be ramped up in an oven and set to a higher temperature. When it is stabilized, recording of the data again will begin again at intervals of 2 minutes for the duration of 30 minutes.
    The first is only to see the real time temperature variation while the program is recording and running. The second graph and data is what I will use to analyze.
    What I need help in is finding out how you can read from the DAQmx at two different time intervals. I tried two parallel loops with each one graphing the two separate graphs I need with a delay time. Those two parallel loops where then surrounded by another while loop. The result is that the outside loop waits until both loops are finished so I do not get the correct results for the real time data graph.
    Is there a way to call on the DAQ data you need at the time interval you desire? Any suggestions to solve this problem? Thank you for your time and help.

    You are on the right track.  Sample the data at the fastest rate and send it to the 1st graph.  For the slower graph, take a sample from the faster data at your desired time interval.  You could use a timer and a case structure for something quick and easy and still have everything run in the same loop.  You could use two loops running at different speeds, it is just a little more involved and a few other things to consider. 

  • How to measure query run time and mnitor performance

    Hai All,
                   A simple question. How to measure query run time and mnitor performance? I want to see the parameters like how long it took to execute, how much space it took etc.
    Thank you.

    hi,
    some ways
    1. use transaction st03, expert mode.
    2. tables rsddstat*
    3. install bw statistics (technical content)
    there are docs on this, also bi knowledge performance center.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    BW Performance Tuning Knowledge Center - SAP Developer Network (SDN)
    Business Intelligence Performance Tuning [original link is broken]
    also take a look
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/31b6b490-0201-0010-e4b6-a1523327025e
    Prakash's weblog on this topic..
    /people/prakash.darji/blog/2006/01/27/query-creation-checklist
    /people/prakash.darji/blog/2006/01/26/query-optimization
    oss note
    557870 'FAQ BW Query Performance'
    and 567746 'Composite note BW 3.x performance Query and Web'.

  • How to measure required time(tic-toc) in a vi?

    how to measure required time(like tic-toc in matlab) in a vi?

    There is the Profile>Performance and Memory option under the tools menu. I'm not sure if this is available with other than the professional version of LabVIEW. And, as I already mentioned, you have all of the time functions on the Timing palette. Call Tick Count or Get Date/Time in Seconds before you function and then again after the function is called. Subtract.
    Attachments:
    Yet another elapsed time.PNG ‏4 KB

  • How can I measure time between transitions at digital input

    I am using LabVIEW 6.0 to measure the time duration between 2 transitions in a digital input port. I have a set up including an HP 34970A Data Acquisition unit with the 34907A Multifunction Module plug-in. The LabVIEW program is trying to poll the digital input for level changes and then using the Time function(Tick Count) to check the times at the transitions. However this method doesn't work reliably as I have to measure time periods of 500ms.
    Is there any good way of mesuring time period with the above setup. I don't have a module which connects to the internal multimeter in the 34970A. The other stuff I have are a HP 34903A(Actuator Module) and a HP 33120A(Function/Waveform Generator).
    Any method for m
    ore accurate time measurement with the above setup will be appreciated. If not, what else do I need to make accurate time measurements.

    Frankly I doubt that you're going to be able to measure time interval with much accuracy. You're periidically polling a static digital input and how often you poll is going to vary. You could try polling as fast as possible and eliminate as many background tasks as you can. If your tolerance for the measurement is plus or minus 100 msce, then maybe you'll get a decent measurement most of the time. If it's plus or minus 5/10 msec, then it will never happen. The pc's clock is just not that accurate and a software timed loop on Windows is not deterministic enough. Get a counter/timer board for something really accurate or use a scope to capture the waveform.

Maybe you are looking for

  • Cisco asa 5505 with Router 881w Configuration Help

    Hello all, I'm having trouble setting up a second vlan to route to the internet. I have a Cisco ASA 5505 connected to my ISP(OUTSIDE) and a Cisco 881w (INSIDE) router in the back of my firewall. My vlan 10 with the network 192.168.5.1 255.255.255.0 w

  • G/L Acc  Opening Balances.............

    Hi  ........   I am working on ECC 6.0 . I am developing a report which will fetch the opening balance for the starting date in given select options and closing balance for last date in given select options and need to show all the Dr , Cr  transacti

  • Movie not on apple tv list, but is playable by apple remote (iphone)

    Sorry about the crazy title, I don't know how to say this succinctly. I have just gotten a new apple tv and have synced several movies to it, but still have my entire library on my mac pro streaming to it. There are a couple of movies that show up on

  • NoClassDefFound error when using custom Java package in scripting QPAC

    Hi, I compiled a little Java-package (.jar), which contains a class that uses com.adobe.workflow.datatype.form.FormDataTypeInstanceImpl. I put my library in the lib folder of JBoss (...\server\all\lib). Then I'm was trying to invoke my custom class i

  • Can we use BWA 7.2 with BW 7.0 SP23?

    Hi, Can anyone confirm if we can use BWA 7.2 with BW 7.0 (SP23)? We are planning on implementing BWA and would want to explore if we can install the highest version of BWA (7.2)  with BW 7.0 and then upgrade to BW 7.3 to use all the new functionaliti