xPCI-3009 API
PCI-3009 timer/counter/watchdog functions

Functions

_INT_ i_PCI3009_TmrCptWatInit (DWORD_ dw_BoardHandle, BYTE_ b_TmrCptWat, DWORD_ dw_OperatingMode, DWORD_ dw_ReloadValue, BYTE_ b_TimeBase, DWORD_ dw_OutputAction, BYTE_ b_InterruptEnable)
 
_INT_ i_PCI3009_TmrCptWatEnable (DWORD_ dw_BoardHandle, BYTE_ b_TmrCptWat)
 
_INT_ i_PCI3009_TmrCptWatDisable (DWORD_ dw_BoardHandle, BYTE_ b_TmrCptWat)
 
_INT_ i_PCI3009_TmrCptWatGetStatus (DWORD_ dw_BoardHandle, BYTE_ b_TmrCptWat, PDWORD_ pdw_Value, PBYTE_ pb_DownStatus, PBYTE_ pb_TriggerStatus, PBYTE_ pb_OutputState)
 
_INT_ i_PCI3009_TmrCptWatTrigger (DWORD_ dw_BoardHandle, BYTE_ b_TmrCptWat)
 

Detailed Description

Function Documentation

_INT_ i_PCI3009_TmrCptWatInit ( DWORD_  dw_BoardHandle,
BYTE_  b_TmrCptWat,
DWORD_  dw_OperatingMode,
DWORD_  dw_ReloadValue,
BYTE_  b_TimeBase,
DWORD_  dw_OutputAction,
BYTE_  b_InterruptEnable 
)

Read the selected digital input channel

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_TmrCptWat: Selected timer/counter/watchdog (0 to 2)
[in]dw_OperatingMode: Timer/counter/watchdog operating mode selection
PCI3009_TIMER
Enable the timer down count mode. After initialization the timer is set to dw_ReloadValue.
After the activation the timer is decremented all seleted time base (micro s, milli s or s).
After dw_ReloadValue decrements to timer reload the value dw_ReloadValue and can generated a interrupt.
PCI3009_UP_COUNTER
Enable the counter up count mode. After initialization the counter is set to 0.
After the activation the counter is incremented for each high level input puls (Input 1 for counter 0, Input 2 for counter 1 and Input 3 for counter 2).
After dw_ReloadValue - 1 increments puls to counter reload the value 0 and can generated a interrupt.
PCI3009_DOWN_COUNTER
Enable the counter down count mode. After initialization the counter is set to dw_ReloadValue.
After the activation the counter is decremented for each high level input puls (Input 1 for counter 0, Input 2 for counter 1 and Input 3 for counter 2).
After dw_ReloadValue decrements puls to counter reload the value dw_ReloadValue and can generated a interrupt.
PCI3009_WATCHDOG
Only available for timer/counter/watchdog 1 and 2.
Watchdog 1 is used for the analog outputs.
Watchdog 2 is used for the digital outputs.
After initialization and activation the watchdog is ready. The next hardware access start the watchdog and each next access reload the watchdog.
If no access occur into the selected time, the watchog run down and the outputs are reseted an the watchdog can generated a interrupt.
[in]dw_ReloadValue: Define the reload value for the down mode and the max value for the up mode.
[in]b_TimeBase: Timer/watchdog time base selection.
PCI3009_MICRO_SECOND :micros
PCI3009_MILLI_SECOND :ms
PCI3009_SECOND :s
[in]dw_OutputAction: Each timer/counter/watchdog have a digital output affected.
  • Outpout 0 for timer/counter/watchdog 0
  • Outpout 1 for timer/counter/watchdog 1
  • Outpout 2 for timer/counter/watchdog 2
    PCI3009_SET_LOW:
    Set the output to low by a timer/counter/watchdog run down cycle.
    For the timer/counter the output is set to high by the next puls.
    PCI3009_SET_HIGH:
    Set the output to high by a timer/counter/watchdog run down cycle.
    For the timer/counter the output is set to low by the next puls.
    PCI3009_FLIP_FLOP:
    Only available for the timers. After the first run down cycle the output is set to high.
    The next run down cycle set the output to low, the next run down cycle set the output to high, ....
    This make a flip flop action.
[in]b_InterruptEnable: Interrupt management.
PCI3009_DISABLE:
No interrupt are generated after a run down cycle.
PCI3009_DISABLE:
Interrupt are generated after a run down cycle.
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: Timer/counter/watchdog selection wrong
-3: Operating mode selection wrong
-4: Reload value selection wrong
-5: Time base selection wrong
-6: Output action selection wrong
-7: Interrupt flag wrong
-8: Interrupt function not initialised
_INT_ i_PCI3009_TmrCptWatEnable ( DWORD_  dw_BoardHandle,
BYTE_  b_TmrCptWat 
)

Enable the selected timer/counter/watchdog. For the watchdog, the next hardware access start the watchdog.

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_TmrCptWat: Selected timer/counter/watchdog (0 to 2)
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: Timer/counter/watchdog selection wrong
-3: Timer/counter/watchdog not initialised
_INT_ i_PCI3009_TmrCptWatDisable ( DWORD_  dw_BoardHandle,
BYTE_  b_TmrCptWat 
)

Disable the selected timer/counter/watchdog.

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_TmrCptWat: Selected timer/counter/watchdog (0 to 2)
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: Timer/counter/watchdog selection wrong
-3: Timer/counter/watchdog not initialised
_INT_ i_PCI3009_TmrCptWatGetStatus ( DWORD_  dw_BoardHandle,
BYTE_  b_TmrCptWat,
PDWORD_  pdw_Value,
PBYTE_  pb_DownStatus,
PBYTE_  pb_TriggerStatus,
PBYTE_  pb_OutputState 
)

Get the selected timer/counter/watchdog status (Actualy value, down status and trigger status).

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_TmrCptWat: Selected timer/counter/watchdog (0 to 2)
[out]pdw_Value: Actualy timer/counter/watchdog value
[out]pb_DownStatus: 0: No run down occur
1: Run down occur
[out]pb_TriggerStatus: 0: No trigger occur
1: Software trigger occur
[out]pb_OutputState: 0: output is low
1: output is high
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: Timer/counter/watchdog selection wrong
-3: Timer/counter/watchdog not initialised
_INT_ i_PCI3009_TmrCptWatTrigger ( DWORD_  dw_BoardHandle,
BYTE_  b_TmrCptWat 
)

Trigger the selected timer/counter/watchdog. Down mode reload the initial value, up mode reload 0.

Parameters
[in]dw_BoardHandle: Handle of board PCI-3009
[in]b_TmrCptWat: Selected timer/counter/watchdog (0 to 2)
Returns
0: No error
-1: The handle parameter of the board is wrong
-2: Timer/counter/watchdog selection wrong
-3: Timer/counter/watchdog not initialised