That's a great question. The two common ways to calculate the frequency I have seen used with the 7831R can be found in LabVIEW under Help >> Find Examples. (Look under the folder Toolkits and Modules >> FPGA >> Frequency Measurement).
The first is called "Count and Period (FPGA).vi" and counts the number of rising edges since the last sample event and measures the total period from the first to last edge in the measurement window. The count can then be divided by the period to determine the frequency.
The second is called "Fixed Count.vi" and measures the total period of a programmable number of rising edges. The programmed count is divided by the period to determine the frequency.
Jeff M.
Applications Engineering
National Instruments