05-20-2011 03:22 PM
I have an 8-slot compactDAQ chassis, cDAQ-9178.
I am using Windows/CVI version 8.5 with DAQmx version 9.3 drivers.
I would like to use one of the PFI channels that are provided on this chassis [0/1] to measure a TTL level signal whose frequency is approximately 1KHZ. When I try re-routing or specifiying the PFI channel, using DAQmx functions, as the counter source DAQmx reports a resource conflict.
Can this be done?
According to MAX 4.8 it appears that the PFI0/1 signals can be routed to any of the STPC3 counter inputs. What functions do I use to accomplich this?
Solved! Go to Solution.
05-20-2011 08:19 PM - edited 05-20-2011 08:19 PM
Hi Rgulbrandson,
The counter frequency input terminal is set by a task-based route. To control the source of that route, call DAQmxSetCIFreqTerm(myTask, "", "/cDAQ1/PFI0") before committing/starting the task. Immediate routing functions like DAQmxConnectTerms() can't override task-based input routes, which might have caused the resource conflict you saw. However, without seeing the actual error message I can only guess. If DAQmxSetCIFreqTerm() doesn't help, could you post the error message and a snippet of your code?
Brad
05-23-2011 02:41 PM
Thanks Brad!
The function DAQmxSetCIFreqTerm(...) worked just fine. For some reason this function does not show up under my CVI Help Contents. Nor does it give me interactive function help in the CVI editor.
Again thanks for the help.
Attached is a snippet of the code that worked.
05-23-2011 03:16 PM - edited 05-23-2011 03:16 PM
Hi Rgulbrandson,
Glad to hear that it worked.
The CVI function panels and helpfile display the variable-argument function DAQmxSetChanAttribute() instead of displaying hundreds of property-specific functions. DAQmxSetChanAttribute(taskHandle,"",DAQmx_CI_Freq_Term,"/cDAQ1/PFI0") is equivalent to DAQmxSetCIFreqTerm(taskHandle,"","/cDAQ1/PFI0"). I prefer the property-specific functions because they allow the compiler to perform static type checking, but either way will work.
Brad