Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't configure counter units to give Ticks

Hello,

What I need is:
For my application, I have an external signal pulsing at a random frequency and I want to count the number of pulses between 2 another external signals.

What I use is:
NI-DAQmx library version 7.1.0f1
NI 6624 counter/timers board

My problem is:
Whenever I want to configure my task to give me the result in Ticks, I get an error when I start the task.
I use DAQmxCreateCITwoEdgeSepChan(...) with the parameter corresponding to unit set to DAQmx_Val_Ticks.

The error I get is this:
Counter timebase rate must be specified for external counter timebase sources in order for frequency and/or time calculations to be made correctly.

Set the Counter Timebase Rate property to the appropriate value for your external source.

Device: PCI-6624: "Dev1"
Channel Name: GI tete

Task Name: Comptage GI t�te

Status Code: -200143

So I configure the Counter Timebase Rate with the function DAQmxSetCICtrTimebaseRate(...) and I get the following error :

Requested values of the Minimum and Maximum properties for the counter channel are not supported for the given type of device.

The values that can be specified for Minimum and Maximum depend on the counter timebase rate.

Property: DAQmx_CI_Min
Corresponding Value: 1.0

Property: DAQmx_CI_Max
Corresponding Value: 40000.0

Property: DAQmx_CI_TwoEdgeSep_Units
Corresponding Value: DAQmx_Val_Ticks

Property: DAQmx_CI_CtrTimebaseSrc
Corresponding Value: /Dev1/PFI31
Option: 1
Property: DAQmx_CI_CtrTimebaseRate
Corresponding Value: 20000000.0
Property: DAQmx_CI_Min
Value Must Be Greater Than: 1.0e-007
Property: DAQmx_CI_Max
Value Must Be Less Than: 214.7483648
Option: 2
Property: DAQmx_CI_CtrTimebaseRate
Corresponding Value: 100000.0
Property: DAQmx_CI_Min
Value Must Be Greater Than: 2.0e-005
Property: DAQmx_CI_Max
Value Must Be Less Than: 42949.67295

Channel Name: GI tete
Task Name: Comptage GI t�te

Status Code: -200527

Can anybody help me?

Thanks in advance.
0 Kudos
Message 1 of 2
(3,389 Views)
This was a bug in DAQ 7.1, I believe it has since been fixed. But there are some workarounds that will solve the problem for you.

1) Change the value of CI_Max to be less than 214. Due to the bug with the "ticks" units, this value must still be specified to fit the range of the 20MHzTimebase.

2) Just use the "seconds" units and then use the U32 version of read. This will return the ticks value.

As a side note, you may want to consider upgrading to NI-DAQmx 7.2. DAQ 7.2 provides support for digital filters on the 6624. Depending the noise levels of your signals, digital filters may be necessary to ensure proper measurements.

I hope this helps!
gus....
Message 2 of 2
(3,389 Views)