04-26-2008 07:02 PM
Hi,
I’m trying to monitor an input signal and I would like to:
Measure and display the 4 latest Pulse Width of the signal, just like in the picture in the attachment.
The switch can represent the state of the signal (HIGH: switch turning ON and LOW: switch turning OFF).
The problem is that I don’t know how to start to count the
time and stop it at the rising or failing edged. Please help me, thank you in
advance.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11">
04-28-2008 02:23 PM
Hi vietwave,
I’m assuming your final application will be measuring a signal with DAQ hardware and the switch it just a way to test your algorithm. If you have an E or M series DAQ card I recommend using one of the onboard counters to measure the high or low pulse width for you. A great example of how to do this can be found in the NI Example Finder. In LabVIEW go to Help >> Find Examples… >> Hardware Input and Output >> DAQmx >> Counter Measurments >> Period or Pulse Width >> Meas Pulse Width-Buffered-Cont.vi. You can change whether it measures the high time or low time based on how you set the starting edge input on the create channel vi. Falling sets it to measure the low time and Rising will make it measure the high time. You can then manipulate the data returned by the DAQmx read to only display the latest four results. Please let me know if you have any questions and take care.
Thanks,
04-28-2008 02:35 PM
04-29-2008 04:39 PM
Hey vietwave,
Here is a VI I wrote that I think does what you are looking for. It is only going to be accurate down to at most 1 ms, and due to Windows not being deterministic, it probably will not be even that accurate. Let me know what you think and if this helps. Have a great week.
Thanks,
05-01-2008 02:20 PM
Hi Nathan