10-19-2005 01:39 PM
Again, "The second parameter is the channel name parameter that was used with the DAQmx Create Channel function. If you left it blank, i.e. "", you can leave the second parameter blank."
You did indeed leave the channel name parameter blank in the DAQmx Create Channel function:
DAQmxCreateCIFreqChan (freqTask, "Dev1/ctr0", "", 2.0, 600000.0,
DAQmx_Val_Hz, DAQmx_Val_Rising,
DAQmx_Val_LowFreq1Ctr, 5, 4, "");
So your function needs to look like this:
DAQmxSetCIFreqTerm(freqTask, "", "/Dev1/PFI8");
02-05-2007 03:24 PM
DAQmxCreateCIFreqChan (freqTask, "Dev1/ctr0", "", 2000.0, 20000.0,
DAQmx_Val_Hz, DAQmx_Val_Rising,
DAQmx_Val_LowFreq1Ctr, 5, 4, "");
So how do I write the call to connect ctr0 gate input to PFI15? Does DAQmxSetCIFreqTerm() automatically use 4 inputs, so that I need to specify the first of 4 sequential inputs (i.e. PFI12) and the inputs are automatically assigned as src, gate, aux, and out? Or what?
Thanks,
Bryan
02-05-2007 03:48 PM
measTime | float64 | The length of time to measure the frequency or period of a
digital signal, when measMethod is DAQmx_Val_HighFreq2Ctr. Measurement accuracy increases with
increased measurement time and with increased signal frequency. |
06-12-2008 07:05 AM
06-13-2008 10:03 AM
So how do I write the call to connect ctr0 gate input to PFI15?That is what DAQmxSetCIFreqTerm does, yes. What you pass in as the string is what is connected to the gate of the counter. The source is whatever you set your timebase as (it should default to the 80MHzTimebase usually). However, if you want to be explicit or use an external timebase then you could use DAQmxSetCICtrTimebaseSrc (and use DAQmxGetCICtrTimebaseSrc to see what it is using by default). The aux and out aren't used for this operation.
1. In the function call:You are correct, the value 5 is only used when doing DAQmx_Val_HighFreq2Ctr measurement method. Otherwise it is ignored. Similary for divisor. Since you're using DAQmx_Val_LowFreq, the measurement can be thought of as Implicit. The signal is routed to the gate of the counter and causes the value of the counter (which is counting the source, or timebase) to be latched so that your application can read it. From that data we know that one period of your signal was X number of ticks of known timebase rate, and we can calculate the frequency.
DAQmxCreateCIFreqChan (freqTask, "Dev1/ctr0", "", 2000.0, 20000.0,
DAQmx_Val_Hz, DAQmx_Val_Rising,
DAQmx_Val_LowFreq1Ctr, 5, 4, "");
What is the value 5? According to the help, it is:
12-17-2009 08:34 AM
hi ,guys,u just have to do like this ,i tried it and it was ok,1.DAQmxCreateCIFreqChan(taskHandle,"Dev1/ctr0","……)
2.DAQmxSetCIFreqTerm(taskHandle,"Dev1/ctr0","/Dev1/PFI12")
OKay, that is all, wish u good luck
12-17-2009 08:36 AM