How to read the register values from energy meter using Modbus Master library?

Hello friends,

Hope you all doing well.

I'm having a difficulty on reading the Input Register values from SELEC MFM384-C Energy meter which uses Modbus protocol and RS-485 communication standard.

Arduino compatible MAX485 chip built in RS-485 module was used to establish the RS-485 connection.

To check the input from the energy meter, I tried to get the input of V1N. (I've attached the datasheet of Energy meter with this post)

Here is the code I tried to get the 16 bit reading from register address starting from 30000 with the length of 2.

#include <ModbusMaster.h>

//ID = 0
//Serial1 (Tx1, Rx1)
ModbusMaster node(1, 0);


void setup()
{
  node.begin(9600);
  Serial.begin(9600);
}


void loop()
{
  static uint32_t i;
  uint8_t j, result;
  uint16_t data[6];

  i++;


  result = node.readHoldingRegisters(30000, 2);

  // do something with data if read is successful
  if (result == node.ku8MBSuccess)
  {
    for (j = 0; j < 6; j++)
    {
      data[j] = node.getResponseBuffer(j);
      Serial.print(data[j]);
    }
    Serial.println();
  }

}

I've used Serial1 for Modbus and Serial0 for Serial monitor.
PIN configuration:
Tx to DI
Rx to RO
DE & RE are interconnected with a jumper and and connected to PIN 3

I'm net getting any serial monitor outputs.

I checked the source code from the library, and couldn't find a trigger on how this works. Please kindly help me to solve this.

Thanking you in advance :slight_smile:

OP_MFM384_MFM384-C_OP347-V05.pdf (851 KB)

Check out this following string, It is really well documented with several meter reading application discussed on this thread.
Simplemodbus RTU
It is easy to implement, hope it will guide you properly, and if you get any problem you can post it there!

Yatin

Hi there ..
are you able to connect selec meter ? I am in the same boat now.
I am using Selec MFM384 to arduino Mega . using RS485 to TTL converter (RS485-TTL Module [4519] : Sunrom Electronics) .
however I am unable to get any response. could you please explain the connections and related stuff. I tried a lot but no success so far.

Thanks,
Ak