ArduinoModbusSlave icon indicating copy to clipboard operation
ArduinoModbusSlave copied to clipboard

Doesn't work on arduino mega 2560.

Open qqq-tech opened this issue 5 years ago • 1 comments

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();
}

qqq-tech avatar May 10 '20 13:05 qqq-tech

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.

falahati avatar May 14 '20 21:05 falahati