Function
Registers the callback function called when the event occurs by the timer set by the function CntNotifyTimer. Supports multi-processing.
Format
Ret = CntTimerCallbackProc ( Id , CallBackProc , Param )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from CntInit.
CallBackProc
[ VB.NET: IntPtr ] [ C, C++: long * ] [ C#: IntPtr ] [ Python: ctypes.POINTER(ctypes.c_long)
]
Specify the address of callback function.
Param
[ VB.NET: IntPtr ] [ C, C++: void * ] [ C#: void * ] [ Python: ctypes.c_void_p
]
Specify the address of parameter that passes the callback. Specify NULL
when the parameter is unnecessary.
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_BUFF_ADDRESS |
10100 |
Invalid data buffer address. |
CNT_ERR_SYS_NOT_SUPPORTED |
20001 |
This function can't be used by this device. |
The others: (See also: Details of Error Code)
Remarks
Use this function to register the callback.
The callback function is called when the interrupt event occurred.
The operation of the callback function looks like the event, but it differs
from the event, the window handle is unnecessary.
So it is possible to use the callback function even by the application
without the window.
This function is used to the interrupt notification set by the function CntNotifyTimer by the callback.
Therefore, it is necessary to set the interrupt notification condition by using the function CntNotifyTimer beforehand.
Example
Registers the callback function for function CntNotifyTimer.
VB.NET |
Please refer to [Note of Using Visual Basic .NET]. |
C, C++ |
long Ret; |
C# |
Please refer to [Note of Using Visual C#]. |
Python |
Ret = ctypes.c_long() |
See Also
CntNotifyTimer CntStopNotifyTimer
Callback Function
Format
void CallBackProc ( Id , wParam , lParam , Param )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Passes the device ID retrieved from CntInit.
wParam
[ VB.NET: Integer ] [ C, C++: WPARAM ] [ C#: int ] [ Python: ctypes.wintypes.WPARAM
]
Passes the parameter by the driver. It does not use it now.
lParam
[ VB.NET: Integer ] [ C, C++: LPARAM ] [ C#: int ] [ Python: ctypes.wintypes.LPARAM
]
Passes the parameter by the driver. It does not use it now.
Param
[ VB.NET: IntPtr ] [ C, C++: void * ] [ C#: void * ] [ Python: ctypes.c_void_p
]
Passes the parameter specified for the function CntTimerCallbackProc.
NULL is stored here when NULL is specified for the parameter.
Return Value
None