eMBMasterRegDiscreteCB() function
Callback function used if a Input Discrete Register value is read by the protocol stack. If you are going to use his function you might use the functions xMBUtilSetBits( ) and xMBUtilGetBits( ) for working with bitfields.
Arguments
pucRegBuffer
The buffer should be updated with the current coil values. The first discrete input starting at \c usAddress must be stored at the LSB of the first byte in the buffer. If the requested number is not a multiple of eight the remaining bits should be set to zero.
usAddress
The starting address of the first discrete input.
usNDiscrete
Number of discrete input values.
Return value
The function must return one of the following error codes: - eMBErrorCode::MB_ENOERR If no error occurred. In this case a normal Modbus response is sent. - eMBErrorCode::MB_ENOREG If the application does not map an coils within the requested address range. In this case a ILLEGAL DATA ADDRESS is sent as a response.