How can i measure the time between two successive rising edges ,using digital input ..

Hello
I'm trying to measure the time in seconds between each two successive rising edges on a digital input .
Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
but I don't know how to do this
Can somebody please help me !!!
note: the time that I'm measuring ranges between 200 ms - 2 seconds
Solved!
Go to Solution.
Attachments:
Counter without time.vi ‏11 KB

Cheers for that. It's always a good idea to post your SubVIs as well - the problem could be in one of those.
To help you out:
You already know how to use shift registers so why not use one again for time? Create a new shift register for  the time then simply compare the "rising edge time" to the the previous time stored in the shift register and then write the new time to the shift register.
Just a few other pointers:
1. You'll want to initialise your shift registers ie wire a constant to the left hand register outside of the loop. This will cause the register to be reset each time the program is run. This is so that your counter will start from zero each time you run your code.
2. You don't need to use the "greater than?" compare function with boolean as they can only be true or false (1 or 0)! The "Equal?" function is what you should use here.
3. Lastly, it's a small thing but you can use the same tunnel that feeds into a case structure in each of the cases - no need to create two tunnels for the true and false cases, use the same one.
-CC
"If anyone needs me, I'll be in the Angry Dome!"

Similar Messages

  • How can I measure the time between each two successive rising edges ,using Digital Input ?

    Hello
    I'm trying two measure the time in seconds between each two successive rising edges on a digital input .
    Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
    all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
    but I don't know how to do this
    Can somebody please help me !!!
    Solved!
    Go to Solution.
    Attachments:
    Counter without time.vi ‏11 KB

    Woah!  
    Sorry Apok, but your code is becoming way too complicated/messy. I don't think that all of those shift registers or boolean conversion/operators are needed at all.
    If you want to measure the timing between two button presses then this is a different (much less complicated) way. It simply records the timing of the button press into a shift register then compares the two.
    Spoiler (Highlight to read)
    Of course this is a very quick and basic solution just to show you that it can be much simpler than you are making it (remember to use the mechanical actions of the buttons to get the behaviour you want).
    A better way would be to use an event structure looking at value changes of the buttons to determine the timings between clicks.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"
    Attachments:
    Time between clicks.vi ‏9 KB

  • How can i measure the time between a pulse output and a pulse back on the input?

    Llo,
    I have a problem i use a ultrsonic sensor, and when i send a pulse out of 4V then a couple of ms i have a pulse back on the input, how can i exactly know how much time there is between the 2 ^pulse??

    Use the output pulse to trigger a counter in period measuring mode and stop the counter on the return signal (if the input return signal is large enough to reliably trigger a logic circuit). If the signal is not large enough to trigger the counter directly, an external comparator can be used to generate the stop signal.
    Another approach is to use two channels of analog input. Feed the output signal to one of them and the return signal to the other channel. The time between outgoing and return pulses can be determined from the sampling rate. If precise timing is required and your AI board does not have simultaneous sampling, you have to account for the inter-channel time as well.
    Lynn

  • LabVIEW/SignalExpress: How can I automate measuring the time between two pulses?

    Hi everyone, bit of a newbie here so please bear with me.  
    I'm a student at a university conducting a muon decay experiment with an oscilloscope connected to some photomultipliers.  To summarize, if a muon enters the detector it will create a very small width pulse (a few ns).  Within a period of 10µs it may decay, creating a second pulse.  The oscilloscope triggers on the main pulse 5-15 times per second, and a decay event happens roughly 1-2 times per minute.  I am trying to collect 10 hours of data (roughly 1500-2000 decay events) and measure the time it takes for each decay.
    I've been able to set recording conditions in SignalExpress that starts recording on the first pulse and stops recording on the last.  The Tektronix TDS 1012 oscilloscope however feeds 2500 points of data from this snapshot into a text file (for use in excel or other software).  Even if I perfectly collected the data, I would have 100,000+ data points and it would be too much to handle.  I don't know how (or if it's possible) to reduce the sample size.
    To conclude, using Labview or SignalExpress, I would like to be able to have the software
    1.  Differentiate between the single pulse detections and double pulse decay events
    2.  Record only when two pulses appear on the oscilloscope
    3.  Measure the time between these two pulses and ONLY that to minimize the amount of data recorded.
    Any help would be GREATLY appreciated, thanks!

    Hi wdavis8,
    I am not that familiar with Tektronix, but there should be a place in the dialog that you go through when you create the action step to acquire date to specify a sampling rate. That would allow you to reduce the number of data points you are seeing, but may reduce the quality of the data.
    If it’s just a matter of that much data being hard to dig through when you have that many points, you could do some analysis on the data after the fact, and then create a new file with only the data you want to look at. For example, you could identify the peaks in the data, and based on the distance between them or the difference in magnitude, selectively write data to a new file.  
    Here is some information about peak detection in LabVIEW:
    http://www.ni.com/white-paper/3770/en/
    You could also do some downsampling on the data to get fewer data points:
    https://decibel.ni.com/content/docs/DOC-23952
    https://decibel.ni.com/content/docs/DOC-28976
    Those are just a few quick ideas. 
    Kelsey J
    Applications Engineer

  • How can i set the space between two button?

    Hello,
    I have
    <mx:HBox>
    <mx:Button label="one" />
    <mx:Button label="two" />
    </mx:HBox>
    how can i set the distance between this two compotents?
    Thanks

    quote:
    Originally posted by:
    robinbouc77
    Hi,
    you can use horizontalGap property on HBox to change the
    space between your buttons. I think the default value is 6. You can
    also use <mx:Spacer/>, but changing the gap on HBox is
    probably the cleanest way ;)
    C U
    perfect!!! works fine

  • How can I measure the time difference between spikes (interspik​e intervals)

    I have used NI USB-6008 (DAQ) to sample a continous signal, after sampling I compared the amplitude of the resulted signal with a value. If the amplitude is greater than a specific value (threshold) then it can pass. Now I want to measure the time difference between the resulted samples. The samples look like spikes. (May be if I trigger a timer, then I can measuer the time difference, but I have not seen such a timer). 
    Thanks in advance,
    Saraydin

    Oops just occured to me that you are using a 6009 which is not very fast, 48ks/sec, this will not get you very much time resolution and you could have issues seeing much of a 50 us sample.  Another approach is to use the counter but you would have to preprocess the spikes to generate a trigger for the counter.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How can we measure the time of excecution of our Java program?

    i have a java application program which runs depend upon the user input.
    I want to analyze how my application works.
    So i want to measure the time of execution.How can i do it?

    makpandian wrote:
    ..i want to measure the time of execution.
    long startTime = System.currentTimeMillis()
    doTimeConsumingTask();
    long endTime = System.currentTimeMillis()
    System.out.println(  "The task took " + (startTime-endTime)/1000 + " seconds." ); Edit 1:
    I see I was 'too slow off the mark' by 5 minutes. ;)
    Edited by: AndrewThompson64 on Jul 19, 2009 10:58 PM

  • How can I measure the frequencies of two analog input signals simultaneously?

    Hi
    I have two AI signals, and I need to determine the frequencies of those signals. The frequencies range from 1-125Hz. I currently have a VI where I can sample one of the signals for 1 second (sampling at 300 Hz for 300 samples) and determine the frequency. 
    I need to read two signals at the same time and get both of the frequencies at the same time, but I can only figure out how to read them individually, so I can read one signal, then one second later I read the second one, then I read the first one again, then the sceond one, etc..  How can I read two signals simultaneously?
    Thanks
    Attachments:
    FreqMeas11.vi ‏41 KB
    FreqMeas11.PNG ‏18 KB

    "at same time", this depends on the hardware, you can do as has been previously stated just set up a 2 channel acquisition and you will get 2 sampled waveforms back.  Most hardware A/D as multiplexed and true simultaneous sampling is not done.  At 125Hz this is not an issue unless you are interested in very small phase changes between the samples.  just keep this in mind if you are expecting samples to be completly synchronized.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • How can I reduce the time between songs to zero for seemless mixing

    Hi, Ive only just got my 5th generation Ipod and was wondering if its possible to reduce the time gap between songs to zero. I.E a lot of Cd's and albums I have are mixed so it doesnt seem there is a pause between each song but when I put the cd's onto my ipod there is still a pause.
    For example I have a 2 many djs album which is heavily mixed with a new song every 30 seconds so it is a bit of a nuisance if there is a pause every 30 seconds.

    Your question gets asked on a daily basis, and has been answered many times. If you search for 'gapless playback' you'll see how just how many people inquire about this.
    In short... the iPod does not support gapless playback.
    If you want to eliminate the gaps, one workaround is to join the individual tracks together, and play them as one single track. You can do this by reimporting the CD into iTunes using the 'Join CD Tracks' feature.
    See Step 3 in this article:
    http://docs.info.apple.com/article.html?artnum=93079
    If you'd like to send feedback to Apple to ask that they include gapless playback as a feature in future revisions of the iPod firmware, you can do so on this feedback page.

  • How can I set the time between how long my phone plays a text msg ringtone if I don't respond the first time?

    If I don't respond the first time, how can I set how many times/seconds it plays the next time until I respond?

    Actually, there is!
    http://www.apple.com/feedback/iphone.html

  • How can I specify the "linkage" between two XMLType columns?

    Hello all,
    I'd like to know whether I can do the following in Oracle 10g R2. Table A has a column C1 of XMLType; table B has a column C2 of XMLType; and C2 has an element links to C1's content (the root element) - not a copy of that.
    Thanks
    Cy

    In theory an DBURI can be used, making use of the DBURIServlet which is part of the XML DB Infrastructure
    /oradb/SCHEMA/TABLE[predicate]... I'm not sure I'd recommend this approach.
    XLink, XInclude and XPointer are the right techniques to do this. As I in my earlier post we don't do anyhting special to enforce or resolve these techniques in the current production product. You can store documents that contain these kind of links in the database. If you organize your content approriately in the XML DB repository you can resolve these links programatically today.
    We will be doing some interesting work to support all of these standards to a greater or less extent in a future release of the database. To use the repository to manage these links it will be necessary to create a resource that allows URL based access to each document that you want to link to. You can create links to existing content by obtaining a REF to the XMLType and then foldering the REF under the required URL.
    Note that this technique cannot be used to refer to XMLType stored in columns of XMLType in an relational table, only to rows of XMLType in an XMLType table.

  • How can i compute the time elapsed between two pulses or the period of an encoder signal if I dont have a constant rpm?

    I need to compute the rpm of an engine using information from an optical encoder attached to it. the engine is running in transient mode so the encoder pulse doesnt have a constant frequency. I need to get the period betwwen two rising or falling edges using DAQmx.
    Any ideas?

    Using an M Series or TIO device you can measure the period between two edges (on two different signals) using the two edge separation measurement.  I'm assuming that you don't want to use position measurement because the frequency is varying so much?  If not, you may be able to set the sample clock period short enough that you get a decent average RPM measurement.
    gus....

  • How can I change the space between a checkbox and text all at one time? I have a lot of checkboxes in my form.

    How can I change the space between a checkbox and text all at one time? I have a lot of checkboxes in my form.

    Okay, I haven't found a way to add an extra space using Find/replace, but you might be able to add some text wrap to the check boxes that will push the text away from them.
    Open Find/Replace and click the Object tab.
    Click the Specify attributes to find button to the right of the Find Object Format: field.
    Under Basic Attributes, choose Stroke and then the Black swatch (assuming the black swatch is applied to the strokes of your check boxes). If there are no other stand-alone objects in your form with a Black stroke, this should be all you need. (If there are Black strokes on your table cells, they will be ignored.)
    Click OK
    Click the Specify attributes to change button to the right of the Change Object Format: field.
    Under Basic Attributes, choose Text Wrap & Other > Text Wrap > Type: > Wrap around bounding box (2nd button from left)
    Under Offset, set a Right offset at the distance you'd like to add (I don't know what units you use, but the 3-5 points might work for your purposes...might take some trial-and-error to get it where you want)
    Click OK
    Click Change All

  • How to Calculate the Time Between two days in ABAP

    Hi,
                  I have one scenario like i need to calculate the time between two days please can you suggest me.
    Thanks,
    Harinath

    Hi Peeleti,
                Check this code,
    DATA : DATE1 LIKE SY-DATUM VALUE '19830125',
           DATE2 LIKE SY-DATUM VALUE '20070219',
           DAYS1 TYPE I,
           WEEK1 TYPE I,
           MONTH1 TYPE I,
           YEAR1 TYPE I,
           C_YEARS1 TYPE I.
    CALL FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
    EXPORTING
      BEGDA           = DATE1
       endda           = DATE2
      TAB_MODE        = ' '
    IMPORTING
      DAYS            = DAYS1
      C_WEEKS         =
      C_MONTHS        = C_YEARS1
      C_YEARS         = C_YEARS1
      WEEKS           = WEEK1
      MONTHS          = MONTH1
      YEARS           = YEAR1.
      D_MONTHS        =
      MONTH_TAB       =
    *WRITE : / 'DAYS   = ', DAYS1,
            / 'WEEKS = ',WEEK1,
          /  'MONTHS = ', MONTH1,
          / 'YEARS   = ', YEAR1.
    Using this code you can calculate the No Of Days Between two dates. Based On days you will easily calculate the Hour. [  No of days * 24 ].
    Thanks.
    Reward If helpful.

  • How can i compute the distance between every two strias

    how can i compute the distance between every two strias?The distances between every two strias in an image are almost equal .I have a picture for you in the accessory.there are many trias in all kinds of orientation in an image.fistly,i should find the most consious area,because it is simple to compute . Secondly,To improve precision,i should compute the distance of a group of trias,then conpute its average value.i dont know how to compute .pls teach me,thanks very much!
    Attachments:
    11.jpg ‏12 KB

    there is a typical image.
    Attachments:
    21.jpg ‏23 KB

Maybe you are looking for

  • Bad secondary ide channel?

    Windows kept blue screening when i installed a new k9n2 board - i finally tried swapping the primary and secondary cables (HD's are now on secondary channel and dvd is on primary channel). Now it runs fine except the dvd drive doesnt show in windows.

  • Can FCP directly output to Beta Cam? if not what is the best output result?

    I wonder which way is the best result to output the video to beta tape for TV broadcasting. I used firewire to DV but once the TV station dup to beta, the picture gettin worst.

  • CIF Integration Model block.

    Good morning Our outbound CIF queue in R/3 is being blocked every hour when job APO_CIF_ALL_INT_MODELS runs. The error message says "Location does not exist for external location 1265" Can anyone help? Thanks in advance. Guy.

  • Adobe crashes every time I try to watch You Tube

    For 9 solid days we have tried to watch You Tube and the Adobe Flashplayer crashes everytime.  We have done everything known to man to fix it.  We can play Farmville but not watch BBC videos.  We have cleaned the computer, unloaded and reloaded Adobe

  • Summarised JIT call from ECC to SRM

    Dear friends, I am creating a summarised JIT call in ECC 6.0. It is also creating an IDoc. I want to send this IDoc to SRM so as to make it available to my suppliers. Please, let me know the procedure. Thanks!! Shalini