DRV_DioReadDIPorts

INT32S DRV_DioReadDIPorts(
   PTR_T DeviceHandle,
   INT32U dwPortStart,
   INT32U dwPortCount,
   INT8U *pBuffer );

Purpose

On the device indicated by the DeviceHandle, it reads back the DI port data from a specified range of DI ports.

Parameters

Some parameters, such as starting port number (dwPortStart), port count (dwPortCount) and pointer to the user's buffer (pBuffer), are stored in the DRV_DioReadDIPorts.

The user needs to provide a buffer that is large enough to store retrieved data.

Name Direction Range Description
DeviceHandle input default The pointer retrieved from the DRV_DeviceOpen which specifies the target device.
dwPortStart input default The starting port number.
dwPortCount input default The port count.
pBuffer output default The pointer to the user's buffer that saves DI data.

Return

   1. 0 Successful.
   2. InvalidDeviceHandle The DeviceHandle is NULL.
   3. InvalidChannel The port is configured incorrectly. The start 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.