How to measure the pulse duration of a TTL signal using AI?

Hi there.
I would like to know how to measure the pulse duration of a TTL signal using an Analog input.
These TTL signals comes from an ultrasonic sensor's output. The pulse width of the signal is
proportional to the distance of the object the sensor detected.
I have tried using the example "Measure Pulse Width.vi" which uses a counter to measure the
pulse duration instead. It provides me with correct results.
However, i will like to know how can i do it using the AI instead.
I tried it by using the example "Acq&Graph Voltage-Int Clk.vi" which i modified by including a
timing and transistion measurement vi. Pulse duration was selected as the output. A graph indicator was also added at the output of the pulse duration to monitor the incoming TTL signals.
However, everytime the TTL signals was detected on the graph indicator, the numeric indicator always produce a "zero" reading.
I have attached my vi for your reference.
Can anybody advice me what i have done wrongly?
Regard.
Attachments:
Acq&Graph Voltage-Int Clkv1.vi ‏190 KB

Hi Paul,
Today i tried using 2 different methods to read the pulse duration of my sensor signal.
Both methods use "Acq&Graph Voltage-IntClk" vi as a guide.
Method1:
Add a filter vi(lowpass/bandpass) and a timing and transition measurements vi.
Pulse duration is selected as the output. With some numeric conversion, a centimeter
reading indicator was created. However, the reading always remains as "zero"
Method2:
Add a Mask and Limit Testing vi and a timing and transition measurements vi.
By adjusting my upper and lower limits, i manage to "filter" a single pulse out from the actual signal.
However, like the earlier case, the cm reading still remains at "zero"
I have attached both the methods resulted waveforms for your reference.
Are there anything that you can advice on?
Regard.
Attachments:
Results_Waveforms.doc ‏141 KB

Similar Messages

  • Measure the Pulse duration by using NI PCI6250 counter module

    Hai All,
    For my application i need to measure the pulse duration from encoder signal.Encoder PPR is 1024. Maximum speed is 4500 rpm.Encoder signal is connected with NI PCI6250 card Counter input. If i configured my NI DAQ task as a Pulse duration measurement icant able to get prober pulse duration. Pulse duration some times reads as zero or near to zero and values also varies. I dont want average pulse duration. I need each pulse duration.Can any one help me to solve my problem?...
    Regards,
    Vijay.  

    Can any one Help me to solve the above problem
    Regards,
    Vijay

  • How to measure the time of evolution of a signal in a graph and to compare this time measured with a known value?

    For my application, I am obliged to measure the time of evolution of a signal acquired (from T1 to t2) by an analogical entry of a module NI 9203, and to compare this value with a value known in order to judge if this time of evolution is correct or not.
    PLEASE I prefer an example for better understanding.

    Greetings Jacob,
    I am not sure what you mean with 'time of evolution' but normally you acquire at a certain acquisition rate. How much time that has passed, you can calculate by checking how much points are between your two points of interest.
    If you are acquiring at 5Hz, the time between every point is 200ms. If there are let's say 10points between your two points of interest, 2s have passed.
    Regards,
    Wouter
    National Instruments

  • How to measure the baseline of a noisy, pulsed signal

    Hi
    I am measuring the torque exerted by a large motor on a shaft using a load cell and lever arm. The shaft runs at approx 150 rpm. I have attached a drawing that shows the output I get. This is a test rig.
    I have written some code that measures the maximum peak out of a group of approx 5 peaks and writes this to a shift register. This gives me an idea of the maximum torque "spike".
    I also wish to measure the baseline torque (due to the bearings in the machine). Even when highly filtered (my noise filter is set to 49Hz) the signal exhibits this noise which is probably due to vibration in the system. The signal is zeroed when the motor is not running.
    Does anyone have an ideas on how to measure the "baseline" torque? The large spike in torque prevents me from doing a running average. Can anyone think of a way of averaging just the noisy part of the signal to get an average value? I aim to to subtract the average baseline torque from the peak value to get an idea of the torque due to the event which causes
    the spike.
    Any help would be greatly appreciated.
    Many thanks.
    Attachments:
    drawing of torque signal.gif ‏26 KB

    Thanks for the reply. I understand what you are saying. However, I might have to modify my method for measuring the peaks if I choose to implement your idea. I have taken a screenshot of my "peak finder" code and attached it.
    Bascially, the reset terminal is wired to a timer which outputs a pulse every few seconds. This resets the vi (a standard NI one I think) and sets the peak magnitude back to zero. This way, I am windowing the signal and measuring the maximum peak in every window. This is what I need to do.
    So I could use a logical filter to feed data to the running average only if;
    the amplitude of the signal is less than a certain threshold
    and if the current value has similar low peaks either side of it
    How would you construct the code to delay the evaluation so that the values in front and behind of the current data point can be analysed?
    thanks again
    Attachments:
    peak_find_screenshot.jpg ‏45 KB

  • How to measure the frequency of a pulse being generated by a counter

    Hi,
    I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
    Attachments:
    autotrain2.vi ‏19 KB

    You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
    How can I generate a pulse train from shaft encoder? (5/13)
    pulse train from encoder (5/15)
    how to measure rpm (5/20)
    How to measure rpm using shaft encoder and labview (5/23)
    This thread (also 5/23)
    I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
    A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
    For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
    Best Regards,
    John Passiak

  • How to measure the duration

    Hi all
    I would like to know how to measure the duration for which the "over temperature" is in on state in the example "Temperature system Demo.vi"
    i would also like to measure the transisent in a sine waveform.
    thanks in advance.
    with regards,
    McFerra
    Attachments:
    Temperature System Demo.vi ‏49 KB

    Hi McFerra,
    Find the attach vi that can solve your question..
    enjoy..
    DoN't FoRgEt To cLiCk KuDoS.....!!!
    Greeting from India,
    Malhar
    Attachments:
    Temperature System Demo.vi ‏46 KB

  • How to measure the period of each consecutive pulse in a pulse train?

    Hello all,
       I am trying to measure every pulse period in a infinite pulse train. the pulse is actually from a encoder(360 pulse per rev) connected to a varing speed shaft. The mean speed is around 6000 rpm at the highest point, and it has periodic variation, this is why I want to measure the instantaneous speed.
       I tried to use A signal of encoder (360 pulse per rev) to connect to CI Period measurement terminal and read 360 sample at a time. but it seems more than half of pulse reading are missing, which looks like that the read vi need some time to finish the measurement of every pulse before it can handle next one, cause it miss some pulse.  The A signal I injected is around 10 KHz. Does my PCI-MIO-16E-4 or DAQ 6036 capable to handle this task?
    thanks
    Feilong

    Hi Conseils,
       Thanks for your reply. I took a look on that discussion thread and started to study the "continously semi period buffered measurement.vi". I set a signal generator which gives 7 pulses once you press its trigger button to verify if that code could pick up all the resault. The frequency is set to 3KHZ.
      I also modified that vi a little bit to explicitly set DMA transfer and changed it to finite sample mode with 6 samples at a vi run.
      The min T value I input was 0.000028 s and max is 0.00042 s, which gives a engine rpm range of 400 rpm to 6000 rpm at 360 pulse per rev.
      And I input 4 into "sample to read" control.
      When I run the vi, after have signal generator output pulses, there's error:
     Error -200278 occurred at DAQmx Read (Counter 1D DBL 1Chan NSamp).vi:1
     Possible reason(s):
    Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.
    Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.
    Attempted to Read Sample: 6
    Property: RelativeTo Corresponding Value: Current Read Position
    Property: Offset Corresponding Value:
        It looks like the sampling procedure stops before the read.vi get enough (was 4 in this case) sample. But the sample I injected was 7 in total and the finite sample property was set to 6, which should satisfy the property of number of sample to read in read.vi.
        Could you please tell me where I am going wrong?
    Many Thanks
    Feilong

  • How to measure the pulsewidth ???

    I tried to use the Timing and Transition Measurements block to find out the Pulse duration/duty cycle of the wave seen in the Waveform chart 3 in the Page 3 of the container, but i get an error saying that the histogram method is not suitable...
    Can you suggest an alternate method to carry out the measurment ? Also please suggest the block that can be used for this purpose...? Thanks in advance and reply asap .....
    Attachments:
    Pulse measurement.vi ‏64 KB

    Is it necessary that i should use a card ???
    I am doing a simulation only...i need to detect the pulsewidth of the signal.
    Also i need to know about the pwm generation block in LabVIEW..Is such a block available??

  • How to measure the performance of Extractor

    Hi,
    How to measure the time taken to by the extractor when executed from rsa3 for a given selection?
    Lot of threads speak about ST05... but these transactions are too granular to analyse.
    How to get the overall time taken.i need the overall time taken and the time taken by the individual SQL statements... please provide specific pointers.
    Thanks,
    Balaji

    Maybe SE30 can help you....
    Regards,
    Fred

  • How to measure the performance of sql query?

    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i...
    It ll be useful for me to write efficient query....
    Thanks & Regards

    psram wrote:
    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i... You might want to start with a feature of SQL*Plus: The AUTOTRACE (TRACEONLY) option which executes your statement, fetches all records (if there is something to fetch) and shows you some basic statistics information, which include the number of logical I/Os performed, number of sorts etc.
    This gives you an indication of the effectiveness of your statement, so that can check how many logical I/Os (and physical reads) had to be performed.
    Note however that there are more things to consider, as you've already mentioned: The CPU bit is not included in these statistics, and the work performed by SQL workareas (e.g. by hash joins) is also credited only very limited (number of sorts), but e.g. it doesn't cover any writes to temporary segments due to sort or hash operations spilling to disk etc.
    You can use the following approach to get a deeper understanding of the operations performed by each row source:
    alter session set statistics_level=all;
    alter session set timed_statistics = true;
    select /* findme */ ... <your query here>
    SELECT
             SUBSTR(LPAD(' ',DEPTH - 1)||OPERATION||' '||OBJECT_NAME,1,40) OPERATION,
             OBJECT_NAME,
             CARDINALITY,
             LAST_OUTPUT_ROWS,
             LAST_CR_BUFFER_GETS,
             LAST_DISK_READS,
             LAST_DISK_WRITES,
    FROM     V$SQL_PLAN_STATISTICS_ALL P,
             (SELECT *
              FROM   (SELECT   *
                      FROM     V$SQL
                      WHERE    SQL_TEXT LIKE '%findme%'
                               AND SQL_TEXT NOT LIKE '%V$SQL%'
                               AND PARSING_USER_ID = SYS_CONTEXT('USERENV','CURRENT_USERID')
                      ORDER BY LAST_LOAD_TIME DESC)
              WHERE  ROWNUM < 2) S
    WHERE    S.HASH_VALUE = P.HASH_VALUE
             AND S.CHILD_NUMBER = P.CHILD_NUMBER
    ORDER BY ID
    /Check the V$SQL_PLAN_STATISTICS_ALL view for more statistics available. In 10g there is a convenient function DBMS_XPLAN.DISPLAY_CURSOR which can show this information with a single call, but in 9i you need to do it yourself.
    Note that "statistics_level=all" adds a significant overhead to the processing, so use with care and only when required:
    http://jonathanlewis.wordpress.com/2007/11/25/gather_plan_statistics/
    http://jonathanlewis.wordpress.com/2007/04/26/heisenberg/
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to measure the size of a table ?

    Dear all,
    May I know how to measure the size of a customized table. I have a list of customized table and I want to monitor the growth of the table size on daily basis.
    Please advise how do I do it.
    Your advice and input will be appreciated.
    Thanks.
    Regards,
    Kent

    Go to DB02 -> Detailed Analysis -> Enter the table name under "Object Name" -> Click history to see  the changes in size by day.
    Regards
    Juan

  • How to measure the size of a string

    windows app store how to measure the size of a string?
    string str = "Hello word windows app store";

    if you need the actual width the string occupies in pixels than use (see
    this MSDN link for more details):
    Graphics.MeasureString(String, Font)
    if you only need the "length" of the string i.e. no. of characters than use (see
    this MSDN link for more details):
    str.Length
    dont forget to bing / google :)
    hope this helps!
    Graphics.MeasureString(String, Font) can not use in windows store app.
    TextBlock has Measure()
    method, as following:
    Size MeasureString(string content, Size availableSize, double fontSize, string fontFamily="Segoe UI")
        TextBlock tb = new TextBlock();
        tb.TextWrapping = TextWrapping.Wrap;
        tb.Text = content;
        tb.FontFamily = new Windows.UI.Xaml.Media.FontFamily(fontFamily);
        tb.FontSize = fontSize;
        tb.Measure(availableSize);
        return tb.DesiredSize;
    Test:
    string str = "Hello word windows app store";
    Size size = MeasureString(str, new Size(800, 600), 40);

  • How to measure the InfoCube size?

    can any body help me regarding this
    how to measure the info cube size?

    1. use transaction se16, infocube table /../f[infocube name] and /.../e[infocube name], count 'number of entries' - total records
    use transaction db02 tablename infocubename - size in bytes
    Re: how can we measure the info cube size
    2. asap methodology
    Re: Lifecycle Implementation
    hope this helps.
    regards
    harikrishna N

  • How to measure the size of an object written by myself?

    Hi all,
    I'm going to measure the performance on throughput of an ad hoc wireless network that is set up for my project. I wrote a java class that represents a particular data. In order to calculate the throughput, I'm going to send this data objects from one node to another one in the network for a certain time. But I've got a problem with it- How to measure the size of an object that was written by myself in byte or bit in Java? Please help me with it. Thank you very much.

    LindaL22 wrote:
    wrote a java class that represents a particular data. In order to calculate the throughput, I'm going to send this data "a data" doesn't exist. So there's nothing to measure.
    objects from one node to another one in the network for a certain time. But I've got a problem with it- How to measure the size of an object that was written by myself in byte or bit in Java? Not.

  • How to set the transition duration of a slide in keynote with applescript

    hi
    how to set the transition duration of a slide in keynote with applescript
    i made an applescript script which converts a numbers file to a keynote presentation
    figured out how to set the transitions but cant find how to set the time
    +set appTransition of slideTransition of current slide to "apple:dissolve"+
    anyone?

    you can send keystrokes to invoke menu commands via shortcuts but as for transition time not sure. You've check the dictionary right? Scripting support is very limited in KN.

Maybe you are looking for