Communication over Energy meter and Arduino UNO using MAX485 via Modbus Protocol

I am using a Schneider Energy meter EM6400 along with RS485<>RS232 LC module and Arduino UNO. The connections are as shown in the image. Pin 6 and 7 of MAX 485 are connected to pins 7 and 14 of the Energy meter which are meant for RS485 Serial Communication.
All other pins of Energy meter are left disconnected.
I am trying to Read Holding Register whose Function Code is 0x03 in Modbus Protocol.
I have tried using many libraries but am not getting any success.
I think I should be getting the values as 0 since I have not connected Energy Meter with Current and Potential Transformers.
But I am getting garbage values.
Library used is Simple ModbusMasterv2rev2 as attached below .

#include <SimpleModbusMaster.h>
#define baud 19200
#define timeout 1000
#define polling 200 // the scan rate
#define retry_count 10
#define TxEnablePin 2 
#define TOTAL_NO_OF_REGISTERS 1
enum
{
  PACKET1,
  TOTAL_NO_OF_PACKETS // leave this last entry
};
Packet packets[TOTAL_NO_OF_PACKETS];
unsigned int regs[TOTAL_NO_OF_REGISTERS];
void setup()
{
  modbus_construct(&packets[PACKET1], 1, READ_HOLDING_REGISTERS, 3900, 1, 0);
 
  modbus_configure(&Serial, baud, SERIAL_8E1, timeout, polling, retry_count, TxEnablePin, packets, TOTAL_NO_OF_PACKETS, regs);
  
void loop()
{
  int i;
  modbus_update();
  
  regs[0] = analogRead(0); // update data to be written to arduino slave
 
  for (i=0;i<11;i++)
  {
  Serial.println(regs[i]);
 }
  Serial.println("**");
}
}

Attachments:
1)Library
2)Circuit Diagram
3)Data Sheet of Energy Meter
4)Output image on Serial Monitor
5)Library Manual

Libraries_for_Arduino_and_Processing-2015-06-03.zip (529 KB)

SimpleModbusMasterManual.pdf (275 KB)

Couldn't attach data sheet of Energy Meter Schneider EM6400 since the file size is too large.

It can be viewed here- http://www.powertechinternational.in/catalouges/SCHNEIDER-CONZERV-EM-6400.pdf

Hi,
Welcome to the forum.

Where in your void setup() do you set the monitor serial baud rate to 19200?

Serial.begin(19200);

Have you installed the terminating resistors needed for RS485?

Tom... :slight_smile:

hello, TomGeorge , i am using rs485 to ttl converter between arduino serial and EM6400 from schneider to i used different examples from google and arduino forum but things not working, please help

That picture is almost useless. We can't see the manufacturer or model number on it. We can't see how you wired it to the Arduino. We can't see how you wired it to the 485 device. A schematic is so much more useful because we can see the connections without following coloured wires and you can write the exact name of each component next to the component.

Which "different examples" did you try? What exactly didn't work? What were you expecting each example to do and what was the actual result?

same connection as @paavni, i can't able to receive data from energy meter to controller

Did anyone find the solution to the above problem? If yes, then please share it.

Have anyone found the solution for this?

Have anyone found the solution for this? I am also facing same problem
Please help me

Hi,
@Ashokjay you would be better off starting a new thread with full explanation of your project and the problems you have, rather than use an old thread.

Thanks.. Tom.. :slight_smile:

Hello All , Good Morning.

Do you have any update on the issue?

if solved this problem please share ,I am facing same issue