Callback function for custom function codes.
If a custom MODBUS function code should be implemented a callback function can be registered. The function is called by the MODBUS stack whenever such a function is encountered.
- Parameters:
-
| pubMBPDU | The MODBUS request sent by the MODBUS master which is pusMBPDULength bytes long. The response should be written into the same buffer and the length of the response should be written to pubMBPDULength . It must not exceed the size of 243 bytes. |
| pubMBPDULen | Length of the MODBUS PDU. |
- Returns:
- If the function returns eMBException::MB_PDU_EX_NONE a response is sent to the master with a length of
pusMBPDULength and the contents of pubMBPDU . Otherwise an exception frame is generated.
|