Instruction manual

AMPDIO DRIVERS
Page 118
Prior Calls registerBoardEx
TCsetMode
See Also TCsetCount
TCgetCounts
TCsetClock
TCsetGate
6.4.5.14 Read Timer's current Count Value TCgetCount
Latches and reads a timer/counter's 16-bit count value, using the counter latch command.
(Prior to version 4.23 of the driver, the read-back command was used, but that never worked
properly on PC24E, PC25E, PC26AT, PC27E or PC30AT.)
i = TCgetCount (h, chip, chan, pcount)
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).
pcount pointer to long: pointer to a long integer
variable into which the count value result will
be placed.
Returns short: OK
or ERRHANDLE
ERRCHAN
Prior Calls registerBoardEx
TCsetMode
TCsetCount
See Also TCgetUpCount
TCsetClock
TCsetGate
6.4.5.15 Read Timer's current Up-Count TCgetUpCount
Latches and reads a timer counter value, in the same way as TCgetCount, but returns the
actual number of clock pulses received, rather than the count value. Note that the 82C54
timers count down to zero from the initial count value, so this function returns ((initial count)
(current count)). Only counter modes 2 or 3 should be used with this function.