MXIO_ReadCoils_Ex

 

This function reads the fix modbus address on/off status for a contiguous group of coils on the same I/O device.

 

C/C++

int MXIO_ReadCoils_Ex( int hConnection,

BYTE bytCoilType,

WORD wStartCoil,

WORD wCount,

BYTE bytCoils[ ]);

 

Visual Basic

Declare Function MXIO_ReadCoils_Ex Lib "MXIO.dll" (ByVal hConnection As Long, ByVal bytCoilType As Byte, ByVal iStartCoil As Integer, ByVal iCount As Integer, bytCoils As Byte) As Long

 

Arguments:

hConnection

Handle for the I/O device connection.

bytCoilType

Coil type to be read.
1
: read coils (output bit).
2
: read discrete (input bit).

wStartCoil

Specifies the starting coil address to be read. The address is beginning at 0.

wCount

The number of coils to be read.

bytCoils

An array that stores the status of coils; each byte holds eight coil values. Bit 0 of 1st byte represents 1st coil status.

 

Return Value:

Succeed

MXIO_OK

Fail

Refer to Return Codes.