Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

hardware connections for recording counter pulse widths

Hi,

I'm new to using DAQmx ANSI C and am attempting to calculate pulse widths.  I have a PCI 6031E series board with SCB-100 break-out block. I've reviewed the example code, PulseWidth_main.c, provided by NI that makes use of counters. I modified it to run in a loop (by creating a buffer, using a while loop, and reading data using DAQmxReadCounterF64). Unfortunately I am getting the following error:
------------------------------------
DAQmx Error: Pulse width measurement was started while the input signal was active,
and no additional pulses were received, which caused the measurement not to
complete during the specified timeout.

When measuring a single pulse width, make sure the measurement counter is started
before the pulse to be measured is active, or provide a timeout sufficient for at least one
additional pulse to be measured.
Task Name: _unnamedTask<0>

Status Code: -200339
-----------------------------------

Has anyone encountered this problem? Perhaps my hardware connections are incorrect. I'm using a function generator to generate a 5 V, 10 ms pulse twice per second, and  conencting it to CTR0 source.
0 Kudos
Message 1 of 2
(3,194 Views)

Hello IUBwork,

The default pin for pulse width measurements is CTR 0 GATE.  Try connecting your signal to this pin and see if that helps.

Let me know your results.

Regards,
Sean C.

0 Kudos
Message 2 of 2
(3,181 Views)