Measure the time between two digital pulse

Hello

For a non-critical calendar application, I need to measure the time interval between consecutive TTL pulses, ranging from the order of 0.5 s for a few seconds, with a low accuracy of +/-10-50ms. The interval being measured varies between the rising edge of the first pulse and the front of the next and so on.

I have several input lines I need to deal with. Because it's a critical machination low cost, I don't want to use digital counters for each line, so I work with an acquisition of data USB6008 and have connected the input rows TTL on the digital inputs of the device. Avoiding will be sufficient.

I found a good example of VI on discussion forums that does almost the same thing, only it uses instead of the DAQ Assistant user input. The VI works including the time the program going on in a while loop. I replaced with the DAQ Assistant output (a channel) user input in the hope that it is still work.

When I run the program in "run once" mode, it seems to work perfectly. However, in "continuous run" it measures only a very small interval, probably just the time between two samples.  I think it has something to do with the help of a while loop in combination with the DAQ Assistant. Anyone who has any suggestions how to solve this problem?

Thank you!

OK... first of all, you should never use the button "run continuously.  I wish that NEITHER would be to eliminate it, but told me that it is sometimes useful for debugging.  If you want your program to run over and over again, use a while loop with a stop"" button.

If I'm reading your code correctly, you make your initial moment, and then collect data from data acquisition.  When one of the channels is "T", you stop your loop and the end time of capture.  (By the way, why you convert your table to a cluster?  Why not just index the appropriate channel in the table directly?)

Since you want to capture the time between two consecutive pulses, you need to know when a transition has occurred... i. e when your digital line went from F (no pulse) to T (pulse start).  This will give you your forehead.  Right now, all you're doing is looking for a value T - so you have no way of knowing if you are looking for to the previous impulse again, or a new impetus.  You also burn 100% of your processor with the way you have your programme in place.

You need a small loop delay so that your VI is not 100% of your hogs CPU time.  Given that you can live with an accuracy of 50msec, what I suggest that you use.

See attached picture for you give an idea of how to implement.  He will probably need some refining operations, but it should point you in the right direction.

I hope this helps.

Tags: NI Software

Similar Questions

  • How can I measure the time between each two successive increase edges, using digital input?

    Hello

    I have tried two measure the time in seconds between each two successive rising edges on a digital input.

    So far I managed to detect the rising edge, increment a counter at each rising edge and take the time during which the increase is edge

    all I need now is subtract edge currently rising from the previous era of edge rising to calculate (T), which can be 1/frequency and display in real time for the user.

    but I do not know how to do this

    Can someone help me please!

    Woah!

    Sorry Apok, but your code becomes much too complicated and salty. I don't think that all records to offset or Boolean conversion/operators are necessary at all.

    If you want to measure the time between two keys so it's another (much less complicated) way. It simply records the time when press button in a registry change, then compares the two.

  • Measure the time between the ridges of the periodic input signal

    We have built a circuit which is supposed to mimic an Exercycle.  We have an IR switch and a spinning wheel, the rccb meets a comparator circuit and the output of the element of comparison, we have running in LabView.  We successfully were able to measure the number of rotations of the wheel and the total distance travelled by the wheel, but are struggling to measure speed.  We cannot find a way to measure the time between picks in real time, which we could then divide the wheel circumference and calculate the speed in real time.  The VI I posted has a square wave simulated rather than the signal we receive on our circuit.  Thanks in advance for the help.

    Jon and David

    I think you're overloading the things trying to get the time between two pulses.  Instead, you can use the VI Express your measures and select frequency for her custom. Then, you can multiply the circumference of the wheel of the frequency to get the speed.

    I hope this helps.

    -Christina

  • Take the time between two values

    Hi people,

    I have a problem and I know idea how to solve... I need help.

    The problem is I want to take the time between two values max as you can see in the chart.

    For example, in the image that I have add

    4.5 - 1 840 = 2.66

    And enter this value in the 'time between mostra '.

    It's that I want...

    But what I think is very complicated, because I don't know how to take the time correctly and does remove...

    Thank you very much

    Any solution?

    Hi jocuma,

    I tried something and hope that helps u.

    Just create two arrays of temperature and voltage. First of all, I'll get the value of the voltage when it is more of a certain value and that same index to get the value of time and store in the shift register.

    When I get the second higher than the limit value, I'll get time and subtract the previous value.

  • How can I measure the time between the two edges of successive increase, using digital input...

    Hello

    I'm trying to measure the time in seconds between each two successive rising edges on a digital input.

    So far I managed to detect the rising edge, increment a counter at each rising edge and take the time during which the increase is edge

    all I need now is subtract edge currently rising from the previous era of edge rising to calculate (T), which can be 1/frequency and display in real time for the user.

    but I do not know how to do this

    Can someone help me please!

    Note: while I am in a position varies between 200 ms - 2 seconds


  • How to find the time between two channels of entry in the data acquisition card or pci 6036

    Hello

    I read a lot-related posts on the simultaneous measurement of two input voltage of similar channels in map data acquisition. I know that the best material is "simultaneous measurments of the Series DAQ cards" but I only pci data acquisition card 6036 and I try to understand what is the time between the reading of the two channels . This period is always constant? (must it rely on a voltage (amplitude, frequency, waveform..). I send the sine wave (s) to the two channels and read the values of V, if they read the same value, the difference should always be zero but I get-0,002 to 0.002 Volt difference (I must find a way to convert it in time). A screenshot of my VI is attached. I wonder how I can accurately measure the time delay between the channel.

    I am open to any suggestion, my final goal to read exactly two channels at the same time ((ou connaître le délai exact donc je peux correspondre les données correspondantes étant donné le temps de retard))

    Hi spinup,

    better you should post your question in the forum of LabVIEW, LabWindows/CVI is used

    Good luck.

  • How can I use 2530 b and 4065 to measure the resistance between two selected pins?

    I want to be able to select 2 corners on a test with 2530 b set-up and measure the resistance between them with a 4065 DMM (PXI all). Ankles in question are each in blocks of 32 different poles, so I can match them in a double configuration 32 x 1 four or 64 x 1 if necessary. I can measure the resistance between several different pine sets as 0 on 33 pine pine, pin 0 at pin 34 pin 0 to 35 pin and pin 1 to 34 pin, pin 1 pin 36, etc.

    I understand how to measure resistance between a given pin and Earth using the the 2530 4065/b using the wizard OR-DMM/Switch Express, but it is unclear if I can measure the resistance between the two pins of selected by different user. I am a newbie of labview, used to write things in c#, so it may be something very trivial (I hope).

    Any ideas?

    Thank you

    -Russ

    Hey Russ,.

    I recommend starting with the following example (located in the Finder the example ('Help' to find examples):)
    "" Material input and output"Modular Instruments ' OR-Switch" niSwitch Dmm Switch Handshaking.vi

    Because you use a scan list, you can simply drag the two connections to the same entry and then the switch will wait for the two to settle before you send a trigger of the DMM... problem solved.  For example, to connect the CH1 to Com0 (DMM +) and CH93 to Com4 (DMM), then take a measure, then connect CH38 and CH120 to the DMM, you would use the entry list of scan to the following address:

    CH1-> com0 & ch93-> com4; CH38-> com0 & ch120-> com4;

    Note You can have as an entry in list of switch module scan.  In addition, you can only have a single advanced analysis and a measure full per switch module.

  • Estimate the time between two computers

    Hello, everyone.

    I want to develop a program for communication between two ip addresses:

    IP1: 192.168.1.100

    IP2: 192.168.1.101

    Suppose IP1 is the server IP2 is the Viewer, then I want to put in place a program to estimate the elapsed time for IP1 contact IP2, but I don't know how to do.

    Also, I want to display the elapsed time for the connection (which varies due to fluctuations in the internet), performing actions such as continuously 'ping' the receiver from the server. Can someone show me the way to achieve this? Thank you very much.

    Best regards

    yukfai88

    Please do not shout

    How about using ping?

    Insert the output in an analysis of string to read the value you need. Sorry my OS is in German so you have to adapt ;-)

  • measure the distance between 2 impulses (PCI-6221)

    Hello

    I have a digital signal that sends a pair of impulses (100ns width each) roughly every 100ms and I measure the time between two pulses of a pair (with a resolution of 100 ns).
    For the moment, I got a card PCI-6221 to accomplish this task. Unfortunately, I have no solution until now only measures of counter, I found measure time between constant frequency signals, i.e. they cannot measure the distance between 2 single pulses.

    Any help / ideas / or even telling me that it is impossible to solve this task are appreciated

    Are the two pulses on the same line?

    If so, you need to just configure a task of the measurement period.  If they are on separate lines, you would use a task of "separation of two-edge.

    You might be to throw off by the timing of it:

    If you do not configure implicit synchronization in your task, will start on the first edge after DAQmx Read is called.  Thus, in order to intercept the signal, that you must configure your task, call DAQmx Read and then start your two squares.

    If you want the task to control the signal continuously, you must configure name timing.  In this case, you will receive a sample on each rising edge of the external signal (assuming that the two impulses on the same line) - If you start the task of counter before starting the production of pulses (which you probably should), then the same samples correspond to the time between pulses, the odd samples would be the time between each series of pulses.

    More information on modes of counting on the 6221 lie in the M series user manual.

    Best regards

  • Measure the time difference between a digital output and an analog input that responded to the questionnaire

    Hallo,

    I use the following system:

    • OR PXI-1044 with controller NI PXI-8109

    • OR PXI-2564 switch module to turn on the monitor of my test device

    • Data acquisition multifunction NI PXI-6259 to measure the signal that responded to the questionnaire jump

    The two cards are the same - PXI trigger bus. For both, PXI-2564 and PXI-6259 I use DAQmx to set the reading and writing of the channels.

    Now, I want to measure the time between the digital output, my unit turns and the analog input, which measures the response of my system.

    I can't do work by myself, please help me!

    I thank Ludwig.

    Hi Ludwig,.

    If you can't give us any VI we have difficulties with to help you.

    Because I Donat knowledge how your program is mounted it is not easy to know where you should enter signals.

    Here's a question similar to yours:

    http://forums.NI.com/T5/LabVIEW/best-way-to-measure-time/TD-p/178704

    and 2 external links:

    http://www.ehow.com/how_8698983_measure-time-LabVIEW.html

    http://objectmix.com/LabVIEW/385152-how-can-i-use-LabVIEW-measure-time-between-analog-pulses.html

  • time measurement between two finite pulse

    Hello Gerd

    Hello to you!

    I need support in the time between two pulses finished measure.

    Please find instant for the wave form, I want to measure the time between yellow and Red","yellow and blue ".

    Can you give me some indication to implement this thing?

    Concerning

    Nitin

    Oops Basics deliver,

    I'll implement the same and let you know if I find any difficulty.

    Thank you man.

  • Dynamic action - Get the difference between two dates + times

    I have problems a little dynamic to work action. I'm trying to get the time between two dates with the time difference.

    Here is what I got (this is apex 4.0):

    Two date pickers + two numbers fields (date/start/end times)

    I created a dynamic action on the page who fires on the point lose focus (above points).

    The real action for the DA is the body of the PL/SQL function:
    declare
      end_date DATE;
      start_date DATE;
    Begin
      start_date := to_char(:P1_START_DATE || ' ' || :P1_START_TIME, 'DD-MON-YYYY HH:MIAM');
      end_date := to_char(:P1_END_DATE || ' ' || :P1_END_TIME, 'DD-MON-YYYY HH:MIAM');
      :P1_HOURS := end_date-start_date;
    End;
    When I change the values on the page, I get the following error:

    AJAX call back Server error ORA-06502: PL/SQL: digital or value error: character number conversion error to set the value.

    I'm guessing that there is a problem with the date formatting, but I can't make it work. Thanks in advance!

    Hi djston,

    because you chose the dynamic action of 'Set value' with the "Body of the PL/SQL function" type you need to return the value. Try the following code

    declare
      end_date DATE;
      start_date DATE;
    Begin
      start_date := to_date(:P1_START_DATE || ' ' || :P1_START_TIME, 'DD-MM-YYYY HH:MIAM');
      end_date := to_date(:P1_END_DATE || ' ' || :P1_END_TIME, 'DD-MM-YYYY HH:MIAM');
      RETURN (end_date-start_date)*24;
    End;
    

    and P1_REQUESTED_HOURS like 'item affected. "

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

    Published by: Patrick Wolf on January 17, 2011 10:54

  • I'm using Labview TDS3000 Tektronix pilot measures the delay between pulses on two different channels

    I use the driver for Tektronix TDS3000 Labview to configure an TDS3034B oscilloscope and I try to measure the gap between the falling edge of a pulse on channel 1 and the edge failling from an impulse on channel 2. It seems that the TDS3034 can measure this in in-house by the use of the measurement on the front panel key, but how do I retreave using your labview driver?

    Hi Tori

    I am now in place and running, I already had the TDS3034B to measure the delay between the pulse on channel 1 and the pulse on two channels, as well as the pulse width tuned to channel 2. This was done by saving the settings on the scope on a diskette and cutting and sticking them in a modified version of the TDS3000 auto setup vi. I created from a simple VI which allowed me to manually enter orders for tektronix and found that the command "measure: meas1: data? went around.

    Thanks for all your support on this issue.

  • How to measure the time elapsed between two steps?

    Hello

    In my script, I ask the subsequences. How can I measure the time it takes each subsequence?

    Something like:

    Statement: StationGlobals.TimeElapsed = 0

    -> SOMETHING HERE TO START A COUNTER<>

    call sous-suite

    Popup: Str (TimeElapsed)

    Thanks for help

    StationGlobals.Time = Seconds()

    ... / / stuff in time

    StationGlobals.Time = Seconds() - StationGlobals.Time

    You can also view the sample report of basic step in 2012 TestStand time (you can now download an eval).

  • Measure the time of the rising edges of a digital stream using a USB-6341

    I have a DAQ USB-6341 map.

    I use Measurement Studio (writing code in c#) on a Windows 7 computer.

    I'm relatively new to the DAQ cards, programming, so I could ask something that is obvious (sorry if this is the case).

    I went out a stream of digital pulses to an analog output channel.  I wired this channel to one input of the meter channel.  I am able to measure the number of edges upward to the inlet of the meter channel (since the digial flow is continuous, the number of rising edges increases with time).

    I would like a time stamp of each rising transition and I like to keep these timestamps in a table without ever growing (or maybe bin these timestamps in a histogram).

    Set up the meter channel to provide the timestamp data? (rather than just count)

    Thank you for your help.

    WRB,

    The meter must be able to measure the relative time between the different edges of your signal.  To do this, you will take care to set the meter to measure time.  It will measure how long a full period of your signal takes.  You can configure edge that you want to start with.  You'll want to set up your timed 'implied' measure.  This sets up the meter to automatically take action whenever a period is over.  While it's not exactly a timestamp, you can find the distance between two edges by adding the time periods between the banks in question.

    I see another technique that you can use.  This would put the counter to edges of County one of the basics of time of your device (it has 100 KHz, 20 MHz and 100 MHz bases long).  Then configure the task to use your signal as a sample (configuration to use rising edge) clock.  Whenever the song occurs, you will get the number of ticks ticks selected timebase that took place at that time.  One thing to note here, however, is that the counters are 32-bit wide, so your code will have to manage the overthrow of this charge if you are using a fast time and base running for long periods of time.

    Hope that helps,

    Dan

Maybe you are looking for

  • Program for automatic life compatibility more blood pressure monitor

    It is a monitor that was sold for W2000 and XP operating system. I try to use it on W7 professional but the USB is not recognized

  • CC with Adobe Lightroom and Photoshop CC - printing problems

    I have a printer Canon Pixma Pro 100.  All of a sudden I have printing problems I've ever had before.  It seems since the last update.  If I want to use the paper 4 x 6 in the Lightroom print Module, the printer will print the 4 x 6.  If I want to pr

  • Impossible to update Acrobat Standard XI

    HelloI have a client with about 8 users and so far I have had problems with 2 workstations. They require an update to Acrobat XI and an error message that the installer has sufficient permissions to modify some files in the installation directory. I

  • Reg: Regular Exp - help

    Hi Experts,I need help to use the regular Expression- WITH t AS) SELECT ' 1234 Angel Villa, House 420 | Detroit | WE | 700129' double txt ) ---------------- SELECT txt, SUBSTR (txt, InStr(txt,'||') + 2, (INSTR(txt,'|',1,3)-INSTR(txt,'||')-2)) val1, R

  • How to organize / group fonts in Photoshop

    When I opened the font drop-down list inside Photoshop, I have more than 300 fonts listed in alphabetical order, most of which I don't use.I installed about 20 fonts that I love. But how do I combine them? After typing and selection of text in Photos