xPCI-1500 API
|
Functions | |
_INT_ | i_APCI1500_InitTimerCounter2 (BYTE_ b_BoardHandle, BYTE_ b_CounterOrTimerSelect, LONG_ l_ReloadValue, BYTE_ b_ContinuousOrSingleCycleSelect, BYTE_ b_HardwareOrSoftwareTriggerSelect, BYTE_ b_HardwareOrSoftwareGateSelect, BYTE b_InterruptHandling) |
_INT_ | i_APCI1500_StartTimerCounter2 (BYTE_ b_BoardHandle) |
_INT_ | i_APCI1500_StopTimerCounter2 (BYTE_ b_BoardHandle) |
_INT_ | i_APCI1500_TriggerTimerCounter2 (BYTE_ b_BoardHandle) |
_INT_ | i_APCI1500_ReadTimerCounter2 (BYTE_ b_BoardHandle, PLONG_ pl_ReadValue) |
_INT_ i_APCI1500_InitTimerCounter2 | ( | BYTE_ | b_BoardHandle, |
BYTE_ | b_CounterOrTimerSelect, | ||
LONG_ | l_ReloadValue, | ||
BYTE_ | b_ContinuousOrSingleCycleSelect, | ||
BYTE_ | b_HardwareOrSoftwareTriggerSelect, | ||
BYTE_ | b_HardwareOrSoftwareGateSelect, | ||
BYTE | b_InterruptHandling | ||
) |
Initializes the component 2 as a timer or a counter.
Important! The timer component internally operates with half of the input frequency.
If the timer is set as a timer, the time period is defined by (2*w_ReloadValue)/InputClock, where InputClock is the value of the input clock in Hz.
This timer/counter supports hardware trigger, i.e. the value is reloaded if the trigger input is high.
This timer/counter also supports hardware gate, i.e. the timer is only counting if the gate input is high.
If the counter is used, input 10 acts as the counter input
If the hardware trigger is enabled, input 11 acts as the trigger input
If the hardware gate is enabled, input 12 acts as the gate input
[in] | b_BoardHandle | Handle of the board |
[in] | b_CounterOrTimerSelect | Selects the component mode ( APCI1500_TIMER or APCI1500_ZAHLER) |
[in] | l_ReloadValue | Defines the starting value of the timer |
[in] | b_ContinuousOrSingleCycleSelect | APCI1500_SINGLE -> if the counter or timer value is on 1, the counter or timer is stopped. APCI1500_CONTINUOUS -> Everytime the counter or timer is on 1, the l_ReloadValue is loaded |
[in] | b_HardwareOrSoftwareTriggerSelect | Select software (APCI1500_SOFTWARE_TRIGGER) or hardware trigger (APCI1500_HARDWARE_TRIGGER -> Input 12 is used for the trigger) |
[in] | b_HardwareOrSoftwareGateSelect | Enable the hardware gate on pin 16 (APCI1500_SOFTWARE_GATE, APCI1500_HARDWARE_GATE) |
[in] | b_InterruptHandling | An interrupt is generated each time the timer or counter expires (APCI1500_DISABLE, APCI1500_ENABLE) |
0 | : No Error |
-1 | : The handle parameter of the board is wrong |
-2 | : Parameter for selecting the timer/counter is wrong |
-103 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_APCI1500_StartTimerCounter2 | ( | BYTE_ | b_BoardHandle | ) |
Starts the counter timer 2 as a timer or a counter (depending on how you initialized it)
[in] | b_BoardHandle | Handle of the board |
0 | : No Error |
-1 | : The handle parameter of the board is wrong |
-102 | : The component is still started, stop it before trying to restart it |
-103 | : The component is not initialized |
-104 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_APCI1500_StopTimerCounter2 | ( | BYTE_ | b_BoardHandle | ) |
Stops the counter timer 2
[in] | b_BoardHandle | Handle of the board |
0 | : No Error |
-1 | : The handle parameter of the board is wrong |
-102 | : Nothing is started on the component (so nothing to stop) |
-103 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_APCI1500_TriggerTimerCounter2 | ( | BYTE_ | b_BoardHandle | ) |
Triggers the counter timer 2, resetting its value
[in] | b_BoardHandle | Handle of the board |
0 | : No Error |
-1 | : The handle parameter of the board is wrong |
-102 | : Nothing is started on the component (so nothing to trigger) |
-103 | : Error while calling IOCTL function (wrong handle ?) |
_INT_ i_APCI1500_ReadTimerCounter2 | ( | BYTE_ | b_BoardHandle, |
PLONG_ | pl_ReadValue | ||
) |
Reads the timer 2 current value
[in] | b_BoardHandle | Handle of the board |
[out] | pl_ReadValue | Current value of the counter timer |
0 | : No Error |
-1 | : The handle parameter of the board is wrong |
-102 | : Nothing is started on the component (so nothing to read) |
-103 | : Error while calling IOCTL function (wrong handle ?) |