Example Code

Calculate Actual Clock Rate

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • LabVIEW

Code and Documents



This code calculates the actual clock rate when dividing down an 80 MHz clock.



When you want the sample clock rate of a particular task to be different than the 80 MHz Timebase of a device, the device must divide down the 80 MHz Timebase. This is done with an integer divisor. Consequently, the actual sample clock rate will not be exactly what is desired. This VI allows you to see what the actual sample clock rate will be without using the DAQmx Timing property node with the SampClk.Rate property.


This example can be modified to calculate the actual sample clock rate for other Timebases, such as a 20 Mhz Timebase.




  • LabVIEW 2012 or compatible


Steps to Implement or Execute Code

There are two portions of this VI. You may calculate the actual clock rate based off of a desired clock rate or based off of an integer divisor.


Additional Information or References

 CalculateActualClockRate 12_0.png

 **This document has been updated to meet the current required format for


David B.
Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.