xPCI-1710 API
xPCI-1710 Edge Time Measurement functions

Functions

_INT_ i_PCI1710_InitETM (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ClockSelection, BYTE_ b_TimingUnit, DWORD_ dw_Timing, PDWORD_ pdw_RealTiming)
 
_INT_ i_PCI1710_EnableETM (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM, BYTE_ b_EdgeLevel, BYTE_ b_TriggerLevel, BYTE_ b_CycleMode, BYTE_ b_FirstTriggerMode, BYTE_ b_InterruptEnable)
 
_INT_ i_PCI1710_DisableETM (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM)
 
_INT_ i_PCI1710_GetETMInitialisation (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM, PBYTE_ pb_TimingUnit, PDWORD_ pdw_Timing, PBYTE_ pb_EdgeLevel, PBYTE_ pb_TriggerLevel, PBYTE_ pb_CycleMode, PBYTE_ pb_FirstTriggerMode, PBYTE_ pb_InterruptEnable, PBYTE_ pb_Enable)
 
_INT_ i_PCI1710_GetETMProgressStatus (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM, PBYTE_ pb_ETMStatus)
 
_INT_ i_PCI1710_ReadETMValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM, DWORD_ dw_TimeOut, PBYTE_ pb_ETMStatus, PDWORD_ pdw_ETMValue)
 
_INT_ i_PCI1710_ReadETMTotalTime (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM, DWORD_ dw_TimeOut, PBYTE_ pb_ETMStatus, PDWORD_ pdw_ETMValue)
 
_INT_ i_PCI1710_ReadETMDutyCycleValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, BYTE_ b_ETM, DWORD_ dw_TimeOut, PBYTE_ pb_ETMStatus, PDOUBLE pd_DutyCycle)
 
_INT_ i_PCI1710_ConvertETMValue (HANDLE h_DeviceHandle, BYTE_ b_ModuleNbr, DWORD_ dw_ETMValue, PDWORD_ pdw_Hour, PBYTE_ pb_Minute, PBYTE_ pb_Second, PDWORD_ pdw_MilliSecond, PDWORD_ pdw_MicroSecond, PDWORD_ pdw_NanoSecond)
 

Detailed Description

Function Documentation

_INT_ i_PCI1710_InitETM ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ClockSelection,
BYTE_  b_TimingUnit,
DWORD_  dw_Timing,
PDWORD_  pdw_RealTiming 
)

Configures all ETM counters of the selected module. The parameters dw_Timing und dw_TimingUnit determine the time base for the measurement. pdw_RealTiming returns the correct time value. Call this function before you call another function that accesses the ETM counter.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ClockSelectionSelection of the reference clock (30: PCI clock (30 MHz), 33: PCI clock (33 MHz), 40: 40 MHz onboard quartz)
[in]b_TimingUnitUnit of the time base (0: ns 1: us 2: ms)
[in]dw_TimingValue of the time base
[out]pdw_RealTimingCorrect value of the time base. Returns the value that corresponds best with the value entered in the dw_Timing
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected input clock is wrong
-5The selected time unit is wrong
-6The selected time base is wrong
-7The 40 MHz cannot be configured on your board
_INT_ i_PCI1710_EnableETM ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM,
BYTE_  b_EdgeLevel,
BYTE_  b_TriggerLevel,
BYTE_  b_CycleMode,
BYTE_  b_FirstTriggerMode,
BYTE_  b_InterruptEnable 
)

Enables the ETM counter of the selected module. The function "i_PCI1710_InitETM" has to be called first. If the interrupt is enabled, the ETM counter generates an interrupt after each trigger signal.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
[in]b_EdgeLevelEdge selection for time measurement (0: Measures the low level time, 1: Measures the high level time)
[in]b_TriggerLevelSelection of the trigger level (0: Trigger at low level, 1: Trigger at high level)
[in]b_CycleModeMode selection (0: Single mode, 1: Continuous Mode). Each trigger stops the measurement and starts a new cycle.
[in]b_FirstTriggerModeMode of the first trigger 0: The measurement of the first edge time starts after calling the function "i_PCI1710_EnableETM". 1: The measurement of the first edge time starts after the next trigger signal.
[in]b_InterruptEnableEnables or disables the interrupt function. (0: interrupts disabled, 1: interrupts enabled)
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
-6Selection of the edge level is wrong
-7Selection of the trigger level is wrong
-8Mode selection is wrong
-9Mode selection for the first trigger is wrong
-10Interrupt parameter is wrong
-11Interrupt function is not initialised
_INT_ i_PCI1710_DisableETM ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM 
)

Disables the ETM counter of the selected module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
_INT_ i_PCI1710_GetETMInitialisation ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM,
PBYTE_  pb_TimingUnit,
PDWORD_  pdw_Timing,
PBYTE_  pb_EdgeLevel,
PBYTE_  pb_TriggerLevel,
PBYTE_  pb_CycleMode,
PBYTE_  pb_FirstTriggerMode,
PBYTE_  pb_InterruptEnable,
PBYTE_  pb_Enable 
)

Returns the information about the ETM initialisation for the selected module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
[out]pb_TimingUnitUnit of the time base (0: ns, 1: us, 2: ms)
[out]pdw_TimingValue of the time base.
[out]pb_EdgeLevelEdge selection for time measurement (0: Measures the low level time, 1: Measures the high level time)
[out]pb_TriggerLevelSelection of the trigger level (0: Trigger at the low level, 1: Trigger at the high level)
[out]pb_CycleModeMode selection (0: Single mode, 1: Continuous mode). Each trigger stops the measurement and starts a new cycle
[out]pb_FirstTriggerModeMode of the first trigger (0: The measurement of the first edge time starts after calling the function "i_PCI1710_EnableETM", 1: The measurement of the first edge time starts after the next trigger signal).
[out]pb_InterruptEnableEnables or disables the interrupt function. (0: interrupts disabled, 1: interrupts enabled)
[out]pb_EnableReturns whether the ETM is enabled or disabled. (0: ETM disabled, 1: ETM enabled)
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
_INT_ i_PCI1710_GetETMProgressStatus ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM,
PBYTE_  pb_ETMStatus 
)

Returns the ETM state of the selected module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
[out]pb_ETMStatusThe ETM state. (0: No start trigger arrived, 1: A start trigger has arrived, 2: A stop trigger has arrived, 3: An overflow occurred)
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
_INT_ i_PCI1710_ReadETMValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM,
DWORD_  dw_TimeOut,
PBYTE_  pb_ETMStatus,
PDWORD_  pdw_ETMValue 
)

Returns the ETM state and the time value after a stop signal on the selected module. This function is only available when you disable the interrupt function. The returned value is not the actual measured time value. You must use the function "i_PCI1710_ConvertETMValue" or apply the following formula in order to calculate the time value: Time value = pdw_ETMValue x pdw_RealTiming

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
[in]dw_TimeOutSelection of the timeout in ms. (0 to 65535, 0: Blocking until a stop signal has arrived)
[out]pb_ETMStatusThe ETM state. (0: No start trigger arrived, 1: A start trigger has arrived, 2: A stop trigger has arrived, 3: An overflow occurred, 4: Timeout reached)
[out]pdw_ETMValueETM time value.
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
-6The timeout parameter is wrong (0 to 65535)
-7Interrupt routine installed; the measured ETM cannot be read directly
_INT_ i_PCI1710_ReadETMTotalTime ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM,
DWORD_  dw_TimeOut,
PBYTE_  pb_ETMStatus,
PDWORD_  pdw_ETMValue 
)

Returns the ETM status and the total time value after a stop signal occurred on the selected ETM module. This function is only available if you have disabled the interrupt function. The returned value is not the actual measured time value. You must use the function "i_PCI1710_ConvertETMValue" or apply the following formula in order to calculate the time value: pdw_ETMValue x pdw_RealTiming

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
[in]dw_TimeOutSelection of the timeout in ms. (0 to 65535, 0: Blocking until a stop signal has arrived)
[out]pb_ETMStatusThe ETM state. (0: No start trigger arrived, 1: A start trigger has arrived, 2: A stop trigger has arrived, 3: An overflow occurred, 4: Timeout reached)
[out]pdw_ETMValueETM time value.
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
-6The timeout parameter is wrong (0 to 65535)
-7Interrupt routine installed; the measured ETM cannot be read directly
_INT_ i_PCI1710_ReadETMDutyCycleValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
BYTE_  b_ETM,
DWORD_  dw_TimeOut,
PBYTE_  pb_ETMStatus,
PDOUBLE  pd_DutyCycle 
)

Returns the ETM status and the duty cycle value after a stop signal occurred on the selected ETM module. This function is only available if you have disabled the interrupt function.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]b_ETMSelection of the ETM counter (0 or 1)
[in]dw_TimeOutSelection of the timeout in ms. (0 to 65535, 0: Blocking until a stop signal has arrived)
[out]pb_ETMStatusThe ETM state. (0: No start trigger arrived, 1: A start trigger has arrived, 2: A stop trigger has arrived, 3: An overflow occurred, 4: Timeout reached)
[out]pd_DutyCycleETM duty cycle.
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4The selected ETM counter is wrong
-5ETM is not initialised. See function "i_PCI1710_InitETM"
-6The timeout parameter is wrong (0 to 65535)
-7Interrupt routine installed; the measured ETM cannot be read directly
_INT_ i_PCI1710_ConvertETMValue ( HANDLE  h_DeviceHandle,
BYTE_  b_ModuleNbr,
DWORD_  dw_ETMValue,
PDWORD_  pdw_Hour,
PBYTE_  pb_Minute,
PBYTE_  pb_Second,
PDWORD_  pdw_MilliSecond,
PDWORD_  pdw_MicroSecond,
PDWORD_  pdw_NanoSecond 
)

Converts the measured ETM time in hours, minutes, seconds, milliseconds, microseconds and nanoseconds.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleNbrNumber of the module (0 to 3)
[in]dw_ETMValueETM time value. See "i_PCI1710_ReadETMValue"
[out]pdw_HourTime measurement in hours
[out]pb_MinuteTime measurement in minutes
[out]pb_SecondTime measurement in seconds
[out]pdw_MilliSecondTime measurement in milliseconds
[out]pdw_MicroSecondTime measurement in microseconds
[out]pdw_NanoSecondTime measurement in nanoseconds
Return values
0No error
-1The handle parameter of the board is wrong
-2The selected module number is wrong
-3The selected module is not an ETM module
-4ETM is not initialised. See function "i_PCI1710_InitETM"