Function
Registers the callback function called when the event occurs by the count match by the function CntNotifyCountUp. Supports multi-processing.
Format
Ret = CntCountUpCallbackProc ( 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 CntNotifyCountUp by the callback. Therefore, it is necessary to set the interrupt notification condition by using the function CntNotifyCountUp beforehand.
Example
Registers the callback for the function CntNotifyCountUp.
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
CntNotifyCountUp CntStopNotifyCountUp
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
]
LOWORD(wParam)=Channel number of count match * LOWORD
shows the low-word.
HIWORD(wParam)=Direction * HIWORD shows the high-word.
[Definition of Direction]
Definition |
Value |
Description |
CNTM_DIR_UP |
1 |
UP |
CNTM_DIR_DOWN |
2 |
DOWN |
lParam
[ VB.NET: Integer ] [ C, C++: LPARAM ] [ C#: int ] [ Python: ctypes.wintypes.LPARAM
]
Comparison Value
Param
[ VB.NET: IntPtr ] [ C, C++: void * ] [ C#: void * ] [ Python: ctypes.c_void_p
]
Passes the parameter specified for the function CntCountUpCallbackProc.
NULL is stored here when NULL is specified for the parameter.
Return Value
None