Hello everyone,
I try to use this library : https://github.com/jossef/arduino-modbus-slave/tree/master/ arduino-modbus-slave (for Arduino UNO) with an Arduino ZERO. And it don't works correctly(I meet a random problem : lenght error or unknow error when I proceed to a modbus communication between Arduino and PC with CAS Modbus Scanner software).
Furthermore, I use a MAX1485 connected to Arduino ZERO (mode half-duplex). So, I have added an output TX control with a GPIO to control the MAX1485 in the library, see below:
I have to use the ZERO, so, I would like found a solution.
Thank's
Joss
I try to use this library : https://github.com/jossef/arduino-modbus-slave/tree/master/ arduino-modbus-slave (for Arduino UNO) with an Arduino ZERO. And it don't works correctly(I meet a random problem : lenght error or unknow error when I proceed to a modbus communication between Arduino and PC with CAS Modbus Scanner software).
Furthermore, I use a MAX1485 connected to Arduino ZERO (mode half-duplex). So, I have added an output TX control with a GPIO to control the MAX1485 in the library, see below:
Code:
//if a reply was generated
if(_len)
{
int uu;
digitalWrite(7, HIGH);
for(uu = 0 ; uu < _len ; uu++)
Serial1.write(_msg[uu]);
Serial1.flush();
digitalWrite(7, LOW);
//free the allocated memory for the reply message
free(_msg);
_msg = NULL;
//reset the message length
_len = 0;
Serial.println("Reply ok");
}
I have to use the ZERO, so, I would like found a solution.
Thank's
Joss