Instruction manual

AMPDIO DRIVERS
Page 165
See Also TCgetExtPeriod
TCgetExtFreqRestricted
6.4.9.3 Measure Frequency of an External Signal Over a Fixed Period TCgetExtFreqRestricted
Returns the frequency of an external signal, in Hertz, as measured over a specified period.
The external signal must be connected to the clock input of the timer specified by the chip and
chan arguments. See section 3.1.5 for more details on the Frequency/Period Measurement
application.
SUPPORTED IN VERSION 4.42 ONWARDS
i = TCgetExtFreqRestricted (h, chip, chan, width, pfreq, poverflow)
where h short: board handle as issued by the
registerBoardEx function.
chip short: address offset of the timer/counter chip.
One of the following pre-defined constants may
be used:
X1 = 0
X2 = 4
Y1 = 8
Y2 = 12
Z1 = 16
Z2 = 20
chan short: timer/counter channel number within the
chip (0, 1 or 2). Another timer/counter (chan2)
will also be used to provide the gate signal.
This second timer/counter may be on the
previous chip.
width double: width of the measurement gate in
seconds.
pfreq pointer to double: pointer to a 64-bit floating-
point variable into which the frequency result
will be placed.
poverflow pointer to short: pointer to a variable used to
store an overflow indication. A 16-bit counter is
used to measure the frequency. This variable
indicates whether or not the counter
overflowed during the measurement period:
0 = not overflowed
1 = overflowed
Returns short: OK
or ERRHANDLE
ERRCHAN
ERRRANGE
ERRDATA