
5
5
Chapter 5. Modbus Command Sets
Four basic Modbus commands are provided in the Modbus command set. However, you must refer
to the Modbus reference table in ioAdmin to extract data from the Modbus packet.
MXIO_ReadCoils
This function reads the on/off status for a contiguous group of
coils on the same I/O.
C/C++
Arguments
Return Value
int MXIO_ReadCoils ( int hConnection,
BYTE bytCoilType,
WORD wStartCoil,
WORD wCount,
BYTE bytCoils[ ]);
hConnection: Handle for the I/O 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.
Succeed MXIO_OK.
Fail Refer to Return Codes.
Kommentare zu diesen Handbüchern