APCI-/CPCI-1500 Technical
description Chapter 9
84
2) i_APCI1500_InitTimerCounter1 (...)
Syntax:
<Return value> = i_APCI1500_InitTimerCounter1
(BYTE
b_BoardHandle,
BYTE
b_CounterOrTimerSelect,
LONG_
l_ReloadValue,
BYTE
b_ContinuousOrSingleCycleSelect,
BYTE
b_InterruptHandling)
Parameters:
BYTE
b_BoardHandle:
Handle of the
xPCI-1500
BYTE b_CounterOrTimerSelect:
Select
the mode of the first counter/timer
- APCI1500_TIMER :
The first counter/timer is used as timer
- APCI1500_COUNTER :
The first counter/timer is used as counter
LONG
l_ReloadValue:
This parameter has two meanings.
If the counter/timer is used as a counter,
it loads the start value of the counter.
If the counter/timer is used as a timer,
it loads the divider factor for the output.
BYTE b_ContinuousOrSingleCycleSelect: - APCI1500_CONTINUOUS:
Each time the counter value or timer value
is set to "0",
l_ReloadValue
is loaded.
-
APCI1500_SINGLE:
If the counter or timer value is set to
"0", the counter or timer is stopped.
BYTE b_InterruptHandling:
Interrupts can be generated , when the
counter has run down, or when the
timer output is on high.
With this parameter the user decides if
interrupts are used or not.
APCI1500_ENABLE: Interrupts are
enabled.
APCI1500_DISABLE:
Interrupts
are
disabled.
Task:
Selects the operating mode of the first counter/timer. The user enters its start value.
You have to decide:
- if the counter/timer must execute once or several times the counting operation,
- if the counter/timer is used as a counter or a timer,
- and if an interrupt must be generated when the counter/timer has run down.
Return value:
0: No error
-1: The handle-parameter of the board is wrong
-2: The parameter for selecting the counter or the timer is wrong
(APCI1500_COUNTER or APCI1500_TIMER)
-3: Error with the interrupt selection
(APCI1500_ENABLE or APCI1500_DISABLE)
-4: The user interrupt routine is not installed
-5: Cycle parameter is wrong (APCI1500_CONTINUOUS or APCI1500_SINGLE)