Function
Sets the notify for timer. Supports multi-processing.
Format
Ret =CntNotifyTimer ( Id , TimeValue , hWnd )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from CntInit.
TimeValue
[ VB.NET: Integer ] [ C, C++: unsigned long ] [ C#: uint ] [ Python: ctypes.c_ulong
]
Specify the timer value by unit ms.
Allowable setting range:
CNT24-4(PCI)H,CNT24-4D(PCI)H :1<=TimeValue<=200000
Device with sampling function :1<=TimeValue<=6553
hWnd
[ VB.NET: IntPtr ] [ C, C++: HWND ] [ C#: IntPtr ] [ Python: ctypes.wintypes.HANDLE
]
Specify the window handle that receives the notify of timer.
The window handle can be retrieved by m_hWnd for VC.
Specify 0 when using callback without using window message.
Return Value
Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
CNT_ERR_SUCCESS |
0 |
Normality completion |
CNT_ERR_SYS_RECOVERED_FROM_STANDBY |
7 |
Execute the function CntResetDevice to return from the standby mode. |
CNT_ERR_DLL_INVALID_ID |
10001 |
Invalid ID was specified. |
CNT_ERR_DLL_CALL_DRIVER |
10002 |
CNT driver can't be called (Failed in the device I/O control). |
CNT_ERR_DLL_CREATE_THREAD |
10005 |
Failed in the creation of the thread (Failed in CreateThread). |
CNT_ERR_DLL_HWND |
10200 |
Window handle is invalid. |
CNT_ERR_SYS_NOT_SUPPORTED |
20001 |
This function can't be used by this device. |
CNT_ERR_SYS_TIMER_VALUE |
20300 |
Timer value is out of range. |
The others: (See also: Details of Error Code)
Remarks
The following message is posted to the specified window handle when interrupt occurs.
Definition |
Value |
CNTM_TIMER |
1140H |
The following information enters wParam and
lParam that is the parameter of the message respectively.
LOWORD(wParam)=ID retrieved from CntInit
* HIWORD and LOWORD show the high-word and low-word.
Refer to the sample program of each language for the describing details of message processing.
Interrupt is invalid if CntResetDevice is called.
Example
The timer notify is set by the unit of 100msec.
VB.NET |
Dim Ret As Integer |
C, C++ |
long Ret; |
C# |
int Ret; |
Python |
Ret = ctypes.c_long() |
See Also
CntStopNotifyTimer CntTimerCallbackProc