Function
Sets the hardware event of count match. Supports multi-processing.
Format
Ret = CntSetCountMatchHardwareEvent ( Id , ChNo , RegisterNo , EventType , Reserved )
Parameters
Id
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the device ID retrieved from CntInit.
ChNo
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the channel number which you want to set.
RegisterNo
[ C, C++ : short] [Python: ctypes.c_short]
Specify the number of the comparison register.
Allowable range:
0 <= RegisterNo <= 1
EventType
[ C, C++ : int] [Python: ctypes.c_int]
Specify the kind of the hardware event of the count match. The set operation
is performed when count matched. Set the hardware event of count match
from the following table.
Definition |
Value |
Description |
CNT_MATCH_NONE |
0 |
Event specification invalidity |
CNT_MATCH_PRESET |
1 |
Count value preset |
CNT_MATCH_CLEAR |
2 |
Count value zero clear |
Reserved [ C, C++ :
short] [Python: ctypes.c_short]
Specify 0.
Return Value
Ret [ C, C++ : long] [Python: ctypes.c_long]
Definition |
Value |
Description |
CNT_ERR_SUCCESS |
0 |
Normal Complete |
CNT_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
CNT_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
CNT_ERR_SYS_CH_NO |
20201 |
Channel number is outside the range. |
CNT_ERR_SYS_REGNO |
20204 |
Compare register number is out of range. |
CNT_ERR_SYS_EVENT_TYPE |
20302 |
The kind of hardware event is out of range. |
The other errors: (See also: Details of Error Code)
Remarks
This function should be executed before starting the counter.
The case of set Count value preset(CNT_IEVENT_PRSET)
on EventType arrgument,
it will be loaded Preset value set by CntSetPresetRegister
function at the moment the hardware event's condition is met.
Example
C, C++ |
Ret = CntSetCountMatchHardwareEvent
(Id, 0, 0, CNT_MATCH_CLEAR, 0); |
Python |
Ret = ccnt.CntSetCountMatchHardwareEvent
(Id, 0, 0,ccnt._MATCH_CLEAR, 0) |
See Also