Function
Sets the factor for the timer event.
Format
Ret =CntSetTimeUpEvent ( Id , TimeValue , Start )
Parameters
Id [C: short] [Python: ctypes.c_short]
Specifies the device ID retrieved from CntInit.
TimeValue [C: unsigned long] [Python: ctypes.c_ulong]
Specifies the timer value in ms.
Allowable setting range:1 ~ 200000
Start [C: short] [Python: ctypes.c_short]
Specifies whether to start the timer by one of the following defined values.
Definition |
Value |
Description |
CNT_TIMER_STOP |
0 |
Stop the timer |
CNT_TIMER_START |
1 |
Start the timer |
Return Value
Ret [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_DLL_CREATE_THREAD |
10005 |
Failed in creating thread. |
CNT_ERR_SYS_USING_OTHER_PROCESS |
20003 |
It cannot perform because the other process is using the device. |
CNT_ERR_SYS_CH_NO |
20201 |
Channel number is outside the range. |
CNT_ERR_SYS_TIMER_VALUE |
20300 |
Timer value is outside the range. |
The other errors: (See also: Details of Error Code)
Remarks
It is the function which accept the interrupt by using the timer interrupt function of hardware.
Callback function actually accepts the interrupt.
Specifies the callback function in CntSetTimeUpCallBackProc.
This function cannot be used with CPSN-CNT-3202I.
Example
C |
Ret = CntSetTimeUpEvent ( Id , TimeValue , Start ); |
Python |
Ret = ccnt.CntSetTimeUpEvent ( Id , TimeValue , Start ) |
See Also
CntSetTimeUpCallBackProc Count-match