Eastron SDM630 with Modbusmaster

hello, i would really appreciate some help with the problem i'm facing.
I'm trying to read in modbus registers from a energymeter.

i have succesfully read registers from a Schneider IEM 3150 meter, but now i have to read from the Eastron sdm630 meter and i receive errorcode 224, which means invalid response slave ID.

I am using the MAX485 module with DE and RE connected to pin 2.
Pin 9 and 10 are respectively connected to RO and DI.

This is my code now.

#include <ModbusMaster.h>
#include <SoftwareSerial.h>
#include <SD.h>
#define TxEnable 2


// instantiate ModbusMaster object
ModbusMaster node;
SoftwareSerial mySerial(9,10); 
File myFile;

void preTransmission()
{
  digitalWrite(TxEnable, 1);
  

}

void postTransmission()
{

  digitalWrite(TxEnable, 0);
  

  
}




void setup()
{
  // use Serial (port 0); initialize Modbus communication baud rate
  Serial.begin(9600);
  mySerial.begin(9600);
  node.begin(1, mySerial);
  pinMode(TxEnable,OUTPUT);
  node.preTransmission(preTransmission);
  node.postTransmission(postTransmission);
  
}
void loop()
{
  uint8_t result;
  uint8_t  Test;

  Test = node.available();
  result = node.readInputRegisters(0x0000 ,2);
  Serial.println(result);
  delay(2500);
    
   
}

Thank you in advance.

Check the settings of baudrate, parity, stop bits and Modbus ID.

Check that you don't got the M-Bus variant. According to the manual the M-Bus variant will let you set an ID after setting the bus address.

Dear, thanks for taking your time anwering this thread. Turns out my MAX485 module was defective, because it worked with another MAX485 module.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.