LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sum low pulse width over fixed time period

Hello,

 

I'm using a NI cDAQ-9178 with the NI 9411 DI module.  I'm looking to read a (not very clean) ~100kHz square wave

signal and sum the low pulse width (1-3us each) over a 5ms period.  The falling transition is relatively clean, but

the rising transition is a bit slow (0.5-1us).

 

Any advice on how to code this?  I've looked at the counter examples for measuring pulse width and semi-periods,

but the values I get with those examples do not match what I measure with an oscilloscope.

 

Thanks,

 

Anna Liao

0 Kudos
Message 1 of 4
(2,328 Views)

Hi Anna

 

It does not sound like you are receiving any errors, but maybe the suggestion provided in the document I Get Error -10920 When Counting Square Waves without an Adequate Rise Time can help in your application. It sounds like it could explain why your values do not appear correct.


Milan
0 Kudos
Message 2 of 4
(2,302 Views)

Hi Milan,

 

Thanks for the reply.  Actually, I just used the measure semi-period finite with fixed number of samples.  I adjusted the number of samples so that I get a total duration of approx. 5 ms.  I then just sum the respective arrays for low pulse widths and high pulse widths.  The values seem to match what I get from the scope, so I think this is a reasonable way to approximate the measurement I am interested in.

 

Anna

0 Kudos
Message 3 of 4
(2,292 Views)

Hi Anna,

 

I am glad that you found a workaround that helps for your application and shared it with us!

 

Have a Great Weekend,

 

 


Milan
0 Kudos
Message 4 of 4
(2,283 Views)