DioDmSetStopEvent


Function

Sets that the message of transfer completion is notified.

Format

Ret = DioDmSetStopEvent ( Id , Direction , hWnd )

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from DioInit.

Direction [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set the transfer direction.

Definition

Value

[Dec]

Description

DIODM_DIR_IN

1

Input

DIODM_DIR_OUT

2

Output

hWnd [ VB.NET: IntPtr ] [ C, C++: HWND ] [ C#: IntPtr ] [ Python: ctypes.wintypes.HANDLE ]
Specify the window handle to receive the message of transfer completion.
The window handle can be retrieved by m_hWnd in VC.
Specify it to 0 when you want to use callback function but not window message.

Return Value

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal completed.

DIO_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute DioResetDevice function because the device has recovered from standby mode.

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Not call the driver (Failure on DEVICE I/O CONTROL).

DIO_ERR_SYS_NOT_SUPPORTED

20001

This board couldn't use this function.

DIO_ERR_SYS_IODIRECTION

20500

Direction value is out of range.

The others (See also: Details of Error Code)

Initial Value

None

Remarks

The completion of the sampling/generating can be notified when this function is used.

The message ID is defined with DIO_DMM_STOP = 1350H. By specifying a window handle to hWnd, when the sampling/generating completed, the DIO_DMM_STOP message is posted to the specified window handle through the PostMessage function. The parameters of the message are wParam and lParam containing the following information respectively.
LOWORD(wParam)=ID retrieved from DioInit
LOWORD(lParam)=Transfer direction (DIODM_DIR_IN or DIODM_DIR_OUT)
* HIWORD indicates the high-order word. LOWORD indicates the low-order word.
For details about message handling, please refer to the sample programs of each language.

Example

Sets that the message of input transfer completion is notified.

VB.NET

Dim Ret As Integer
Ret = DioDmSetStopEvent ( Id , DIODM_DIR_IN , Handle )
 

C, C++

long Ret;
Ret = DioDmSetStopEvent ( Id , DIODM_DIR_IN , m_hWnd );
 

C#

int Ret;
Ret = dio.DmSetStopEvent ( Id , (short)CdioConst.DIODM_DIR_IN , Handle );
 

Python

Ret = ctypes.c_long()
handle = ctypes.windll.user32.FindWindowW(0, "Interrupt")
Ret.value = cdio.DioDmSetStopEvent ( Id , cdio.DIODM_DIR_IN , handle )
 

See Also

DioDmTransferStart DioSetStopCallBackProc