Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse width display in an array

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

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

Download All
0 Kudos
Message 1 of 5
(3,230 Views)

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,

Nathan
NI Chief Hardware Engineer
0 Kudos
Message 2 of 5
(3,208 Views)
Hi Nathan

Thank you for answering to my message. You are right, my application is measuring the pulse width of a signal. The thing is: I have to use the PCI-DIO-96 board. That is why I have to use software to measure it. I know that with a board which has a counter, the job is much easier but I don't have that kind of board :(.
0 Kudos
Message 3 of 5
(3,201 Views)

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,

Nathan
NI Chief Hardware Engineer
0 Kudos
Message 4 of 5
(3,176 Views)

Hi Nathan

 


Thank you a lot for your software, that is exactly what I need. Thank you again and have a good day.

0 Kudos
Message 5 of 5
(3,155 Views)