How to measure the time a pulse is high for?

I am using Pulse measure.vi to measure the output of a comparator. My comparator output feeds to an LED. The duty cycle is 50% so the LED just flashes on and off. I want to measure the time the output is high ('ON time') and I have been getting this by just multiplying the pulse width measure by the no. of pulses but I want to modify it to measure the 'ON time' of random signals with different duty cycles...
The aim is that I am taking in a signal and need the LED to turn on when the signal 'ON time' reaches a certain specified time.
But before I continue with the LED I am wondering how to add up the time the signal is high for?

Hi PinkLady4218,
You should be able to use one of the shipping examples to do what you need, please open LabVIEW and go to Help >> Find Examples.
From the Example Finder please go to Hardware Input and Output >> DAQmx >> Counter Measurements >> Period or Pulse Width >> Meas Buffered Semi-Period-Continuous.vi
You will then need to deinterleave the output array as it will show high time then low time then high time then ...
You will need to confirm the order these values appear and then you can use a function from the arrays palette and use the function "Decimate 1D Array"
Regards
JamesC
NIUK and Ireland
It only takes a second to rate an answer

Similar Messages

  • 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 time?

    i have two buttons. first the user has to press the first button, then he has to press the second one. I want to measure the time between the two clicks? How can I do this?
    thx Ingo

    The method with the timer will work fine in this case...I thinck that creating a timer with a period of 50-100 miliseconds will do the job(this depends of course on the amount of elapsed time that you generaly expect to pass )...the time error will be less than the period of the timer...Of course,this is in client server..
    In web,I thinck you need to use the JAva way...in fact,you can use the java class even in client-server with the java importer...
    If you use a java class even in c-s,the results will be very accurate

  • How to measure the time the cursor hovered over an hot spot

    Hi all,
    I have a task in which participants have to make a decision with two options. Therefore, I have created two hotspots, one for each option. What I want to measure is the time that the mousecursor 'hovers' over each option before a choice has been made (one of the two hotspots clicked). So for instance: if a user first hovers 2,5 seconds above option 1, then goes to option 2, hovers there for .45 seconds, then goes to option 1 again, hovering for .5 seconds before clicking, I want to save those two values (2.5 + .5 = 3.0 s for option 1 and .45 s for option 2) when either hotspot is clicked. I was thinking of using a conditional in my interaction icon using something similar to ObjecOver (which gives which display icon the cursor is currently over), but then have something like HotspotOver (which does not exist). Does anyone know how I can accomplish measuring these hovertimes?
    Regards,
    Frank

    The solution I came up with has five hotspots. First off a calculation icon: OptionTimes := [0,0]
    Then the interaction with the hotspots: single click option 1, cursor in area option 1, single click option 2, cursor in area option 2, finally a hotspot surrounding all others
    In the cursor in area type hotspot for option 1 I have the calculation:
    Option := 1
    OptionStartTime := SystemSeconds
    Hopefully you can see where this is going. There's a similar calc for option 2 in the cursor in area option 2. It just sets the Option number to 2. In the last hotspot that surrounds the others I have this:
    OptionTimes[Option] := OptionTimes[Option] + SystemSeconds - OptionStartTime
    When the user hovers over an option and then leaves, the hotspot surrounding the others catches them and records the time they spent. You also need that same calc in the response path for the two options to catch the time taken looking at the option just before clicking in their choice.
    Mike

  • How to determine the time duration of each job for a particular report

    Hi guys,
    I am facing a very interesting problem which I want to share with all of you-hoping to get some input from you
    enlightened fellas :).
    I have vendor and vendor sub-range maintained in one custom table. For each vendor I have got article site combination maintained in another table. The thing is I have to execute this program in background. Now for each vendor I may have only 1 article or multiple articles. So if I schedule the job for 60 min. say then for 1 article the time alloted will be too big and for multiple articles the time alloted may prove to be too small. Another thing from a functional point of view is a vendor which has 1 article today may have more articles added to his name tomorrow (if the customer likes his product the company may buy more from him). So the point is we have to dynamically adjust the time alloted for each job.
    I could not find any utility in ABAP which can do this.
    Can any of you please help me?
    Thanks a lot !
    Hasso.
    Edited by: Hasso14 on Apr 28, 2011 3:06 PM

    Exaactly-only I want to find the best time needed to finish for an article or multiple articles i.e I do not know how many articles will be available for each vendor beforehand before doing a select on the 2 tables. But once I know the number (maybe 1 or more than 1) I want to allot the best time for that article/lot of articles(maybe JOB_OPEN  technique ?).Also the number of articles may vary over time so the algorithm should take care of that too.-quite a tricky prob :)-I would request the others to see this reply which I think will clarify their doubts.
    Edited by: Hasso14 on Apr 28, 2011 9:03 PM

  • 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

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

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

  • 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 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 measure the performance

    Hi all,
    I would like to compare the performance of my Webdynpros in different machine. I need to measure the time of execution of my Web dynpro, including execution of some interaction from the user (navigation between the pages, etc). How can I do it? I cannot add any additional code, are there any transaction to measure it?
    Thanks a lot,
    Anna

    Thank you.
    I opened this transaction, but I could see only Transaction, Program or Function module to introduce and analyze. How can I measure Webdynpro?
    Regards,
    Anna

Maybe you are looking for

  • How to read every line from a text file???

    How can i read every line from my text file ("eka.txt") now it only reads the first line and prints it out. What is wrong with this? import java.io.*; import java.util.*; class Testi{      public static void main(String []args)throws IOException {   

  • Session variable filters in the integration between OBIEE and webcenter

    Hello All, I have a customer with the requirement to make sure that reports created in answers and containing sessions variables in filters definition will be correctly filtered once called from webcenter. So if an OBI report is diplayed in webcenter

  • Problem with SUMMARY

    When I try using the Service SUMMARY, the application Devon Think on my computer opens. The summary created is very short and ends mid-sentence. Why is Devon Think opening? When I put DevonThink in the trash, Summary did not work saying that Devon Th

  • Windows XP Mode on Windows 7

    Is it normal to have a Windows XP Mode folder in a Windows 7 Pro, Program Files Directory?  I see this key: K49H2-RPR94-QBGG4-DBCTM-YT64G. And I see the VXPEULA.txt file with EULA. Window XP Mode has never intentionally, or knowingly, been installed.

  • Kernel Errors!!!

    Hi All I have a 15" PB Aluminum 1.5ghz with 1GB of ram. Just bought off a friend and when I did a fresh erase and install of OS X 10.4, repaired permissions and rebooted I get the kernel error telling me to hold down the power button and restart. So