Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency Measurment using Compact DAQ Chassis PFI Input

Solved!
Go to solution

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? 

0 Kudos
Message 1 of 4
(6,178 Views)
Solution
Accepted by topic author Rgulbrandson

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

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 4
(6,088 Views)

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.  

0 Kudos
Message 3 of 4
(6,079 Views)

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

---
Brad Keryan
NI R&D
0 Kudos
Message 4 of 4
(6,075 Views)