Enable received data notifications.
Ret = CanNotifyEvent ( Id , ChannelNo , EventType , CallBackProc , Param)
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from CanInit.
ChannelNo
[ VB.NET: UShort ] [ C, C++: unsigned short ] [ C#: ushort ] [
Python: ctypes.c_ushort ]
Specify the channel number.
EventType
[ VB.NET: UShort ] [ C, C++: unsigned short ] [ C#: ushort ] [
Python: ctypes.c_ushort ]
Specify the event type.
Definition |
Value |
Description |
CCAN_EVENT_RECEIVE |
0x01 |
Reception event |
CallBackProc
[ VB.NET: IntPtr ] [ C, C++: PCAN_EVENT_CALLBACK ] [ C#: IntPtr
] [ Python: PCAN_EVENT_CALLBACK ]
Specify the pointer to callback function.
Param [
VB.NET: IntPtr ] [ C, C++: void * ] [ C#: void * ] [ Python: ctypes.c_void_p
]
Specify additional parameters for the callback.
Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
CAN_ERR_SUCCESS |
0 |
Normality completion |
CAN_ERR_SYS_RECOVERED_FROM_STANDBY |
7 |
Execute CanResetDevice function because the device has recovered from standby mode. |
CAN_ERR_DLL_INVALID_ID |
10001 |
Invalid ID specified. |
CAN_ERR_DLL_CALL_DRIVER |
10002 |
Driver can't be called (Failed in the device I/O control). |
CAN_ERR_DLL_EVENT_TYPE |
10300 |
Event type beyond the limit. |
CAN_ERR_SYS_CH_NO |
20101 |
Channel number is outside the settable range |
The others (See also: Details of Error Code)
None
By registering a callback function using this function, the callback function will be called when an event occurs.
Register the callback function that will be called when a message is received (CCAN_EVENT_RECEIVE) in ChannelNo = 1.
VB.NET |
Please refer to Notes
on Using Visual Basic .NET. |
C, C++ |
long Ret; |
C# |
Please refer to Notes
on Using Visual C#. |
Python |
Ret = ctypes.long() |
void CallBackProc ( Id , wParam , lParam , Param )
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
The driver passes the device ID for which the event notification is intended.
wParam [
VB.NET: Integer ] [ C, C++: WPARAM ] [ C#: int ] [Python: ctypes.wintypes.WPARAM]
This parameter is passed from the driver.
Definition |
Value |
Description |
CCAN_EVENT_RECEIVE |
0x01 |
Reception event |
lParam [
VB.NET: Integer ] [ C, C++: LPARAM ] [ C#: int ] [Python: ctypes.wintypes.LPARAM]
The channel number on which the received data is located is passed.
Param [
VB.NET: IntPtr ] [ C, C++: void * ] [ C#: void * ] [Python: ctypes.c_void_p]
The parameter specified by the CanNotifyEvent function is passed.
It will be NULL when the Param parameter was specified to NULL.
None