xPCI-1500 API

Functions

_INT_ i_APCI1500_InitWatchdogCounter3 (BYTE_ b_BoardHandle, BYTE_ b_ComponentMode, LONG_ w_ReloadValue, BYTE_ b_EnableContinuousCycle, BYTE_ b_EnableHardwareGate, BYTE_ b_EnableInterrupt)
 
_INT_ i_APCI1500_StartCounter3 (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_StopCounter3 (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_TriggerCounter3 (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_TriggerWatchdog (BYTE_ b_BoardHandle)
 
_INT_ i_APCI1500_ReadCounter3 (BYTE_ b_BoardHandle, PLONG_ pl_ReadValue)
 

Detailed Description

Function Documentation

_INT_ i_APCI1500_InitWatchdogCounter3 ( BYTE_  b_BoardHandle,
BYTE_  b_ComponentMode,
LONG_  w_ReloadValue,
BYTE_  b_EnableContinuousCycle,
BYTE_  b_EnableHardwareGate,
BYTE_  b_EnableInterrupt 
)

Initializes and start the component 3 as a watchdog or a counter.
Important! The timer component internally operates with half of the input frequency.
If the timer is set as a watchdog, 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 gate, i.e. the watchdog/counter is only counting if the gate input is high.

If the counter is used, input 15 acts as the counter input
If the hardware gate is enabled, input 16 acts as the gate input

Parameters
[in]b_BoardHandleHandle of the board
[in]b_ComponentModeSelects the component mode ( PCI1500_WATCHDOG or PCI1500_COUNTER )
[in]w_ReloadValueDefines the starting value of the timer
[in]b_EnableContinuousCycleReset the timer to us_ReloadValue after each interrupt, and continue counting (0,1)
[in]b_EnableHardwareGateEnable the hardware gate on pin 12 (0,1)
[in]b_EnableInterruptAn interrupt is generated each time the timer or counter expires (0,1)
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: Parameter for selecting the counter/watchdog wrong
-103: Error while calling IOCTL function (wrong handle ?)
-202: The component is not initialized
-203: The component is still started, stop it before trying to restart it
_INT_ i_APCI1500_StartCounter3 ( BYTE_  b_BoardHandle)

Starts the watchdog counter 3 as a watchdog or a counter (depending on how you initialized it)

Parameters
[in]b_BoardHandleHandle of the board
Return values
0: No Error
-1: The handle parameter of the board is wrong
-2: The component is not initialized
-102: The component is still started, stop it before trying to restart it
-104: Error while calling IOCTL function (wrong handle ?)
_INT_ i_APCI1500_StopCounter3 ( BYTE_  b_BoardHandle)

Stops the watchdog counter 3

Parameters
[in]b_BoardHandleHandle of the board
Return values
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_TriggerCounter3 ( BYTE_  b_BoardHandle)

Triggers the watchdog counter 3, resetting its value

Parameters
[in]b_BoardHandleHandle of the board
Return values
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_TriggerWatchdog ( BYTE_  b_BoardHandle)

Triggers the watchdog counter 3, resetting its value

Parameters
[in]b_BoardHandleHandle of the board
Return values
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_ReadCounter3 ( BYTE_  b_BoardHandle,
PLONG_  pl_ReadValue 
)

Reads the watchdog counter 3 current value

Parameters
[in]b_BoardHandleHandle of the board
[out]pl_ReadValueCurrent value of the watchdog counter
Return values
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 ?)