CntCarryBorrowCallbackProc


Function

Registers the callback function called when the event occurs by the counter error by the function CntNotifyCarryBorrow. Supports multi-processing.

Format

Ret = CntCarryBorrowCallbackProc ( 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 for passing CallBack. Specify NULL if parameter is not necessary.

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 CntNotifyCarryBorrow by the callback. Therefore, it is necessary to set the interrupt notification condition by using the function CntNotifyCarryBorrow beforehand.

Example

Register the callback function for the function CntNotifyCarryBorrow.

VB.NET

Please refer to [Note of Using Visual Basic .NET].
 

C, C++

long Ret;
Ret = CntCarryBorrowCallbackProc ( Id , CallBackProc , this );
 

C#

Please refer to [Note of Using Visual C#].
 

Python

Ret = ctypes.c_long()
Ret.value = ccnt.CntCarryBorrowCallbackProc ( Id , CallBackProc , 0 )
 

 

See Also

CntNotifyCarryBorrow CntStopNotifyCarryBorrow


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) = Notic Factor   * LOWORD shows the low-word.

Notic Factor can be given by the following logical sum.

[Definition of Notice Factor]

Definition

Value

Description

CNT_CB_CARRY

1

Carry

CNT_CB_BORROW

2

Borrow

Param [ VB.NET: IntPtr ] [ C, C++: void * ] [ C#: void * ] [ Python: ctypes.c_void_p ]
Passes the specified parameter to function CntCountUpCallbackProc.
Stores NULL if the parameter is specified to NULL.

Return Value

None