ArduinoModbusSlave
ArduinoModbusSlave copied to clipboard
Doesn't work on arduino mega 2560.
Modbus :: createResponse (); If there is no delay (1) or Serial.println ("") before calling the function, it does not work properly.
communication:rs232 baudrate:9600 dataBits:8 Parity:None StopBits:1
uint8_t Modbus::poll()
{
.....
// Validate the incoming request.
if (!Modbus::validateRequest())
{
Serial.println("notvalid");
return 0;
}
//Serial.println("valid");
//delay(1);
// Execute the incoming request and create the response.
uint8_t status = Modbus::createResponse();
}
Please provide information about what exactly happens. Does the library read the full request and the validateRequest() method passes? Does your callback gets executed? Do you get bad response or no response? What is your callback function, please post it here.