Function
Registers the callback function called when the event occurs by the counter error by the function CntNotifyCounterError. Supports multi-processing.
Format
Ret = CntCounterErrorCallbackProc ( 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 CntNotifyCounterError by the callback. Therefore, it is necessary to set the interrupt notification condition by using the function CntNotifyCounterError beforehand.
Example
Registers the callback function for the function CntNotifyCounterError.
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
CntNotifyCounterError CntStopNotifyCounterError
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 * LOWORD shows the low-word.
lParam
[ VB.NET: Integer ] [ C, C++: LPARAM ] [ C#: int ] [ Python: ctypes.wintypes.LPARAM
]
LOWORD(lParam) = Error Kind * LOWORD shows the low-word.
[Definition of error kind]
Definition |
Value |
Description |
CNT_AI_ERROR |
1 |
Abnormal input error |
CNT_FLT_ERROR |
2 |
Filter error |
CNT_ALM_ERROR |
3 |
Alarm error |
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