Alan,
Thanks for the input. I have tried this but it still do not want to work. Here is my function I am trying to use, look at it and tell me what I am doing worng here.
int readFrequency(short sample)
{
int32 sampleRead,
samples;
float64 freqRead[1024],
freqReadAve;
int i;
freqReadAve = 0.0;
samples = (int32) sample;
DAQmxCreateTask ("", &freqTask);
DAQmxCreateCIFreqChan (freqTask, "Dev1/ctr0", "", 2.0, 600000.0,
DAQmx_Val_Hz, DAQmx_Val_Rising,
DAQmx_Val_LowFreq1Ctr, 5, 4, "");
DAQmxCfgImplicitTiming (freqTask, DAQmx_Val_FiniteSamps, samples);
/DAQmxSetCIFreqTerm(freqTask, "/Dev1/PFI8", "/Dev1/PFI8");
DAQmxStartTask (freqTask);
DAQmxReadCounterF64 (freqTask, samples, 2.0, freqRead, 1024, &sampleRead, 0);
DAQmxStopTask (freqTask);
DAQmxClearTask (freqTask);
for(i = 0; i < sampleRead; i++)
freqReadAve += freqRead[i];
measuredFreq = (double)freqReadAve / --i;
return 0;
}
Hiren Patel