xPCI-3501 API
xPCI-3501 Timer watchdog functions

Functions

_INT_ i_PCI3501_InitAndStartTimerWatchdog (HANDLE h_DeviceHandle, DWORD dw_ReloadValue, BYTE b_TimeBase, BYTE b_InterruptFlag, BYTE b_Mode)
 
_INT_ i_PCI3501_StopTimerWatchdog (HANDLE h_DeviceHandle)
 
_INT_ i_PCI3501_TriggerTimerWatchdog (HANDLE h_DeviceHandle)
 
_INT_ i_PCI3501_ReadTimerWatchdogValue (HANDLE h_DeviceHandle, PDWORD pdw_Value)
 
_INT_ i_PCI3501_ReadTimerWatchdogStatus (HANDLE h_DeviceHandle, PDWORD pdw_Value, PBYTE pb_Overflow, PBYTE pb_SoftTrigger, PBYTE pb_ExtTrigger)
 

Detailed Description

Function Documentation

_INT_ i_PCI3501_InitAndStartTimerWatchdog ( HANDLE  h_DeviceHandle,
DWORD  dw_ReloadValue,
BYTE  b_TimeBase,
BYTE  b_InterruptFlag,
BYTE  b_Mode 
)

Initialize and start the component as timer or watchdog.
If you use this component as a watchdog, when the value reaches 0, the analog outputs will be set to 0V.
If you write on an analog output, or if you trigger the watchdog, then the value of the watchdog is reset to dw_ReloadValue.

Parameters
[in]h_DeviceHandleHandle of the board. You can get it with the function i_PCI3501_OpenBoardViaIndex for example
[in]dw_ReloadValueThe time interval. Its unit is defined by the b_TimeBase parameter. (0 to 4095)
[in]b_TimeBaseThe unit of the parameter dw_ReloadValue.
  • 0x1 Unit is microsecond
  • 0x2 Unit is millisecond
  • 0x3 Unit is second
  • 0x4 Unit is minute
[in]b_InterruptFlagSpecify if you want to generate an interrupt when the value of the timer / watchdog reach 0.
[in]b_ModeSpecifiy the mode of the component.
  • 0x0 watchdog
  • 0x1 timer
Return values
0: No error
-1: The device handle parameter is wrong
-2: dw_ReloadValue parameter is wrong
-3: b_TimeBase parameter is wrong
-4: b_InterruptFlag parameter is wrong
-5: b_Mode parameter is wrong
-6: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3501_StopTimerWatchdog ( HANDLE  h_DeviceHandle)

Stop a started timer / watchdog.

Parameters
[in]h_DeviceHandleHandle of the board. You can get it with the function i_PCI3501_OpenBoardViaIndex for example
Return values
0: No error
-1: The device handle parameter is wrong
-2: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3501_TriggerTimerWatchdog ( HANDLE  h_DeviceHandle)

Trigger a started timer / watchdog.

Parameters
[in]h_DeviceHandleHandle of the board. You can get it with the function i_PCI3501_OpenBoardViaIndex for example
Return values
0: No error
-1: The device handle parameter is wrong
-2: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3501_ReadTimerWatchdogValue ( HANDLE  h_DeviceHandle,
PDWORD  pdw_Value 
)

Read the current value of the timer / watchdog

Parameters
[in]h_DeviceHandleHandle of the board. You can get it with the function i_PCI3501_OpenBoardViaIndex for example
[out]dw_ValueThe current value of the timer watchdog
Return values
0: No error
-1: The device handle parameter is wrong
-2: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3501_ReadTimerWatchdogStatus ( HANDLE  h_DeviceHandle,
PDWORD  pdw_Value,
PBYTE  pb_Overflow,
PBYTE  pb_SoftTrigger,
PBYTE  pb_ExtTrigger 
)

Read the current value and the status of the timer / watchdog

Parameters
[in]h_DeviceHandleHandle of the board. You can get it with the function i_PCI3501_OpenBoardViaIndex for example
[out]dw_ValueThe current value of the timer watchdog
[out]pb_Overflow1 if the timer / watchdog reached 0, else 0
[out]pb_SoftTrigger1 if a software trigger occurred, else 0
[out]pb_ExtTrigger1 if a hardware trigger occurred, else 0
Return values
0: No error
-1: The device handle parameter is wrong
-2: Error while calling IOCTL function (wrong handle ?)