DRV_DioEnableEventAndSpecifyDiPorts

INT32S DRV_DioEnableEventAndSpecifyDiPorts( 
   INT32U dwEventID, 
   INT32U dwScanStart,
   INT32U dwScanCount );

Purpose

On the device indicated by the DeviceHandle, it enables  the event specified by dwEventID, and configs a port range to scan when the event occurs.

Parameters

Name

Direction

Range

Description

DeviceHandle

input

default

Retrieved from the DRV_DeviceOpen which specifies the target device.

dwEventID

input

ADS_EVT_DI_INTERRUPT0~127
ADS_EVT_DI_PATTERNMATCH_PORT0~31
ADS_EVT_DI_STATUSCHANGE_PORT0~31

The event type users want to enable.

dwScanStart

input

default

The start port number to scan when the event occurs.

dwScanCount

input

default

The port count to scan when the event occurs.

Return

   1. 0

Successful.

   2. InvalidDeviceHandle

The DeviceHandle is NULL.

   3. InvalidChannel

The port is configured incorrectly. The starting port number (dwPortStart) or the sum of the start number and the port count (dwPortCount) should not exceed the total DI port number.

   4. InvalidBuffer

The user's buffer is configured incorrectly. It should not be NULL.