DioSetTrgCallBackProc


Function

Specifies the trigger event call back function.

Format

Ret = DioSetTrgCallBackProc ( Id , CallBack , Param )

Parameters

Id [C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.

CallBack [C:PDIO_TRG_CALLBACK] [Python: PDIO_TRG_CALLBACK]
Specifies the address of callback function.
Callback function is specified by function pointer, but the specification method varies with the language. Please note it.

Param [C:void *] [Python: ctypes.c_void_p]
Specifies the optional parameter to be passed to the callback function.

Return Value

Ret[C:long] [Python: ctypes.c_long]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal complete

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

DIO_ERR_DLL_CALLBACK

10400

Invalid address of callback function.

The other errors: (See also: Error code details)

Remarks

After trigger callback setting was executed, executes the trigger event setting, when trigger occurs, the set callback function is called.

Example

C

Ret = DioSetTrgCallBackProc ( Id , CallBack , Param );
 

Python

Ret = cdio.DioSetTrgCallBackProc ( Id , CallBack , Param )
 

See Also

DioSetTrgEvent
DioSetTrgCallBackProc
Trigger_Function
PDIO_TRG_CALLBACK