Hardware:
NI Cdaq 9172 with one ni 9422 in slot 5 of the 8 slot rack
The Task is to accurately measure pulse width or semiperiod.
Using NiDaq and visual studio c++, language.
Code samples were acquired from National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width
The problem is simply this.
A 1000 hz square wave is applied to counter one (or counter two, tried both) at the proper teminal of the 9422. The square wave is generated by an Agilent 33220A and is the signal verified by scope, and appears to very accurate in period, amplitude and duty cycle (50%).
Using the Nidaq code examples, and making 10 period measurments using the DAQmxCfgImplicitTiming function returns 10 very accururate period measurments. When performing a measurment on the same signal using the DAQmxCreateCISemiPeriodChan function, the two results returned
for each measurement add up to the 1000 micro second period, however the results returned are approximately 586 micro seconds and 414 micro seconds. This also occurs when trying to measure pulse width using the DAQmxCreateCIPulseWidthChan function. Using the DAQmx_Val_Rising
parameter and 586 uS measurments are retuned. If the parameter DAQmx_Val_Falling is passed the measurments are 414 uS.
Do I have some bad hardware --> the 9422?
I tried changing the signal amplitude from +10V peak to +23Volt peak and the measurements do not change? (period is still accurate)
It appears that the system is having trouble seeing the falling edge of the signal!
Am I missing a ground connection somewhere?
Any suggestions?