Function
Sets the notification of specified time sampling completion.
Format
Ret =CntNotifySamplingCount ( Id , Count , hWnd )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from CntInit.
Count [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python:
ctypes.c_long ]
Specifies the number of sampling cycles at which to send notification.
A message will be sent to the application each time the specified number
of sampling cycles is completed.
Range:
Count <= (FFFFFFh / Sampling channel number)
hWnd
[ VB.NET: IntPtr ] [ C, C++: HWND ] [ C#: IntPtr ] [ Python: ctypes.wintypes.HANDLE
]
Specify the window handle that receives the notification of specified time
sampling completion.
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. |
The others: (See also: Details of Error Code)
Remarks
This function should be executed in the setting stage before sampling starts. The following message is posted to the specified window handle when interrupt occurs.
Definition |
Value |
CNTM_SAMPLING_COUNT |
1151H |
The following information
are contained in wParam and lParam that is the parameter of the message
respectively.
LOWORD(wParam)=ID retrieved from CntInit
lParam=Parameter is passed by the driver. It does not use it now.
* 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.
If CntResetDevice is called, interrupt becomes invalid.
For
Ethernet devices
If communication with the device is lost, the process will
be unregistered and events will no longer be notified.
If you want to perform event notification again, please make
the settings again using this function.
You can check the registration status of the current process
using the CntGetNetCommunicationInfo
function.
Example
Sets the notification of specified time sampling completion.
VB.NET |
Dim Ret As Integer |
C, C++ |
long Ret; |
C# |
int Ret; |
Python |
Ret = ctypes.c_long() |
See Also
CntSamplingCountCallbackProc CntGetNetCommunicationInfo