07-28-2016 12:25 PM
Hello,
I'm using Linux DAQmx, and trying to measure Analog Input Frequency using the PXIe-6341 DAQ card.
There is an ANSI-C example for measuring frequency:
/usr/local/natinst/nidaqmx/examples/ansi_c/Analog_In/Measure_Frequency/Cont_Freq-Int_Clk-SCXI1126
However, the call to DAQmxCreateAIFreqVoltageChan results in the following error:
DAQmx Error: Selected physical channel does not support the measurement type required by the virtual channel you are creating.
Create a channel of a measurement type that is supported by the physical channel, or select a physical channel that supports the measurement type.
Property: DAQmx_AI_MeasType
Requested Value: DAQmx_Val_Freq_Voltage
Possible Values: DAQmx_Val_Current, DAQmx_Val_Resistance, DAQmx_Val_Strain_Gage, DAQmx_Val_Temp_BuiltInSensor, DAQmx_Val_Temp_RTD, DAQmx_Val_Temp_Thrmstr, DAQmx_Val_Temp_TC, DAQmx_Val_Voltage, DAQmx_Val_Voltage_CustomWithExcitation
Task Name: _unnamedTask<0>
Status Code: -200431
Does DAQmx support the Frequency function on the 6341 card, or do we have to use the voltage examples and compute the frequency manually ?
Solved! Go to Solution.
07-28-2016 02:36 PM
07-28-2016 03:04 PM
Agreed. The SCXI 1126 is the only module that supports the AI Frequency channel type.
To build off of what Nathan said, here's a suggestion:
You can use an AI voltage task to acquire your signal and configure an Analog Comparison Event using the DAQmx Trigger properties. The Analog Comparison Event will generate a pulse at a specific level of you signal. You can then use a counter input frequency task to count these pulses and measure the frequency of the signal. This way you are still using hardware to measure your analog signal, instead of extra processing on the host.
I don't have an ANSI C example to share, but I think this LabVIEW community example displays the concept above pretty well.