From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter/Timer internal 80MHz using VC++ / DAQmx

Hello,
I would like to measure pulse width, using the internal timebase of a 6602 device with the DAQmx library availble in VC++.
So far, I managed to use the external PFI lines (using DAQmxSetCICtrTimebaseSrc function), but I need more precision and the internal 80MHz will be just fine.
 
--> How do I configure the counter to use the internal clock ?
 
0 Kudos
Message 1 of 5
(3,490 Views)
The right function for setting the timebase to use for period measurements is hard to find. It's under the Channel Properties, not under the C Functions section of the documentation. The function to set the timebase source is DAQmxSetCICtrTimebaseSrc(). Naturally, the documentation for that function doesn't tell you about possibilities for what to specify (there are lots).

Looking in MAX, with my 6229 device selected, and clicking the Device Routes tab (at the *bottom* of the pane!), I see these timebase choices:



/dev/10MHzTimebase

/dev/20MHzTimebase

/dev/80MHzTimebase *****

/dev/100KHzTimebase

Good luck!
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 2 of 5
(3,484 Views)

Yessssss ! It works.

I used the DAQmxSetCICtrTimebaseSrc() function with (literally) "80MHzTimebase" and it successfully select the internal 80MHz clock.

Indeed, in the Measurment & Automation application, I managed to find all the possible choice available in the drop list. All the PFI lines were listed and at the bottom of the list I was able to choose "20MHzTimebase" or "80MHzTimebase".

Note that I also found out that while you create the channel (CreateSemiPeriodChannel... function or something), if we specify a small enough "minimal" value (25E-9) for the expected measurment, using DAQmx_Val_Seconds unit, it will select implicitly the 80MHz clock. But, I would not rely on this.

0 Kudos
Message 3 of 5
(3,476 Views)


@sttellla wrote:

Yessssss ! It works.

Note that I also found out that while you create the channel (CreateSemiPeriodChannel... function or something), if we specify a small enough "minimal" value (25E-9) for the expected measurment, using DAQmx_Val_Seconds unit, it will select implicitly the 80MHz clock. But, I would not rely on this.






Glad I could help!



Right- the driver will patch up the "best" configuration by default. If you absolutely require the 80 MHz timebase, you are probably correct to set the 80 MHz timebase explicitly. That way if you use hardware that lacks the correct timebase you will get an error instead of a bad measurement.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 4 of 5
(3,472 Views)
Hello

I can't find the DAQmxSetCICtrTimebaseSrc() function for NiDaq 8.0 for CVI?

Is it a particularity of VC++?

Despite I manage to do that with

DAQmxSetChanAttribute (*taskHandle, chan, DAQmx_CI_CountEdges_Term,"/Dev1/100kHzTimebase");

Thanks

Yop!
DanY
0 Kudos
Message 5 of 5
(3,357 Views)