Need Help For MODBUS RS485

Dear TEAM,

I m using ELMEASURE ELECTRICAL METER,I need to take a reading form that meter through RS485 ,
herewith i have enclosed my code and snap shot for what i getting please can any one kindly help me,
bcz i struggle last 30days for this.

i using modbus master.h file

holding register address 40100(starting)

thanks in advance

Mr.PI.

#include <ModbusMaster.h>

#define MAX485_DE 11
#define MAX485_RE_NEG 10
// Generic catch-all implementation.
template <typename T_ty> struct TypeInfo { static const char * name; };
template <typename T_ty> const char * TypeInfo<T_ty>::name = "unknown";

// Handy macro to make querying stuff easier.
#define TYPE_NAME(var) TypeInfo< typeof(var) >::name

// Handy macro to make defining stuff easier.
#define MAKE_TYPE_INFO(type)  template <> const char * TypeInfo<type>::name = #type;

//Type-specific implementations.
//MAKE_TYPE_INFO( int16 )
//MAKE_TYPE_INFO( int32 )
//MAKE_TYPE_INFO( uint16 )
//MAKE_TYPE_INFO( uint32 )
//MAKE_TYPE_INFO( float32 )
MAKE_TYPE_INFO( short )
MAKE_TYPE_INFO( int )
MAKE_TYPE_INFO( float )
//MAKE_TYPE_INFO( HEX )
int i;


ModbusMaster node1;

void preTransmission()
{
  digitalWrite(MAX485_RE_NEG, 1);
  digitalWrite(MAX485_DE, 1);
}

void postTransmission()
{
  digitalWrite(MAX485_RE_NEG, 0);
  digitalWrite(MAX485_DE, 0);
}

void setup() {
  pinMode(MAX485_RE_NEG, OUTPUT);
  pinMode(MAX485_DE, OUTPUT);
  pinMode(MAX485_RE_NEG, OUTPUT);
  pinMode(MAX485_DE, OUTPUT);
  //Modbus communication runs at 9600 baud  
  Serial.begin(9600);
  node1.begin(1, Serial);
  node1.preTransmission(preTransmission);
  node1.postTransmission(postTransmission);
}

void loop() {
   uint8_t result; // 0-255
    //float result; 
    result = node1.readHoldingRegisters(100, 20);
    //Serial.println(result);
    if (result == node1.ku8MBSuccess)
    {
    
    /*  for(i=00;i<21;i++)
      {
      if(i==20)
      {
      Serial.println("ENDED");  
      }
      else{*/
      Serial.println(result);
      Serial.println(node1.getResponseBuffer(0X65));
      float res = node1.getResponseBuffer(0X65);
      float res1 = *((float*)(node1.getResponseBuffer(0X65)));
      Serial.println(res1);
     // Serial.println("UPDATE:");
      delay(2000);
      //}
     // Serial.print("V2: ");
     // Serial.println(node1.getResponseBuffer(103));
    //  delay(2000);
  //  }
/*      float res1 = node1.getResponseBuffer(103);
      float res2 = *((float*)(node1.getResponseBuffer(103)));
      Serial.println(res1);
      Serial.print("V3: ");
      Serial.println(node1.getResponseBuffer(104));
      delay(2000);
      float res2 = node1.getResponseBuffer(104);
      float res3 = *((float*)(node1.getResponseBuffer(104)));
      Serial.println(res1);
      Serial.print("V4: ");
      Serial.println(node1.getResponseBuffer(105));
      delay(2000);
      float res3 = node1.getResponseBuffer(105);
      float res4 = *((float*)(node1.getResponseBuffer(105)));
      Serial.println(res1);
      Serial.print("V5: ");
      Serial.println(node1.getResponseBuffer(106));
      delay(2000);
      float res4 = node1.getResponseBuffer(105);
      float res5 = *((float*)(node1.getResponseBuffer(106)));
      Serial.println(res1);
      Serial.print("V6: ");
      Serial.println(node1.getResponseBuffer(107));
      delay(2000);
      float res5 = node1.getResponseBuffer(107);
      float res6 = *((float*)(node1.getResponseBuffer(107)));
      Serial.println(res1);
      Serial.print("V7: ");
      Serial.println(node1.getResponseBuffer(108));
      delay(2000);
      float res6 = node1.getResponseBuffer(108);
      float res7 = *((float*)(node1.getResponseBuffer(108)));
      Serial.println(res1);
      Serial.print("V8: ");
      Serial.println(node1.getResponseBuffer(109));
      delay(2000);
      float res7 = node1.getResponseBuffer(109);
      float res8 = *((float*)(node1.getResponseBuffer(109)));
      Serial.println(res1);
      Serial.print("V9: ");
      Serial.println(node1.getResponseBuffer(109));
      delay(2000);
      float res8 = node1.getResponseBuffer(102);
      float res9 = *((float*)(node1.getResponseBuffer(102)));
      Serial.println(res1);
      Serial.print("V10: ");
      Serial.println(node1.getResponseBuffer(110));
      delay(2000);
      float res9 = node1.getResponseBuffer(110);
      float res10 = *((float*)(node1.getResponseBuffer(110)));
      Serial.println(res1);
     /* Serial.print("V31: ");
      Serial.println(node1.getResponseBuffer(100));
      delay(2000);
      Serial.print("VLN: ");
      Serial.println(node1.getResponseBuffer(100));
      delay(2000);
      Serial.print("V12: ");
      Serial.println(node1.getResponseBuffer(100));
      delay(2000);
      Serial.print("V1: ");
      Serial.println(node1.getResponseBuffer(100));
      delay(2000);
      Serial.print("V2: ");
      Serial.println(node1.getResponseBuffer(100));
      delay(2000);
      Serial.print("V3: ");
      Serial.println(node1.getResponseBuffer(100));
      delay(2000);
      /*Serial.print("A: ");
      Serial.println(node.getResponseBuffer(13));
      Serial.print("PF: ");
      Serial.println(node.getResponseBuffer(07));*/
    } 
    else 
      Serial.println("Fail");
  delay(100);
}

sketch_may16b123.ino (4.75 KB)

Dear Team,

I need your support for my project Can you guide me
I m using ELMEASURE ELECTRICAL METER,I need to take a reading form that meter through RS485 ,i getting Result from that meter through MY Arduino CODE, here I attached my code
but its is hex format i dont know how to convert in FLOAT32 format
i using your software for checking its working properly can you help me for this.
bcz i struggle last 30days for this.

Please Help ME.

thanks in advance

#include <ModbusMaster.h>
#include <SoftwareSerial.h>
#include <IEEE754tools.h>
#undef int
#include <stdio.h>


#define LED_13           13  // define LED pin
#define MAX485_TX_ENABLE  7  // EIA-485 transmit control pin
#define EIA485_RX         9  // EIA-485 serial receive pin
#define EIA485_TX        10  // EIA-485 serial transmit pin

ModbusMaster node;
SoftwareSerial RS485Serial(EIA485_RX, EIA485_TX); // RX, TX

void preTransmission() {
  digitalWrite(MAX485_TX_ENABLE, true);
}

void postTransmission() {
  digitalWrite(MAX485_TX_ENABLE, false);
}

void setup() {
  pinMode(MAX485_TX_ENABLE, OUTPUT);
  digitalWrite(MAX485_TX_ENABLE, false);

  Serial.begin(9600);
  RS485Serial.begin(9600);

  node.begin(1, RS485Serial);
  node.preTransmission(preTransmission);
  node.postTransmission(postTransmission);

  Serial.print("My Little SCADA System\n");
}

void loop() {
  uint32_t result;

  result = node.readHoldingRegisters(100, 20);//40000 40100 0X9CA4

  if (result == node.ku8MBSuccess)
  {
    Serial.print("Reg 1: ");
    Serial.println(node.getResponseBuffer(1));
    uint16_t x=node.getResponseBuffer(1);
    Serial.println(x);
    Serial.println(x, HEX);
    Serial.print("Reg 2: ");
    Serial.println(node.getResponseBuffer(17));
    uint16_t xy =node.getResponseBuffer(17);
    Serial.println(xy);
    Serial.println(xy, HEX);
    
  }
  else {
  Serial.print("Error getting data\n");
  }

  delay(1000);
}

sketch_may28a.ino (1.4 KB)

Dear Team,

I need your support for my project Can you guide me
I m using ELMEASURE ELECTRICAL METER,I need to take a reading form that meter through RS485 ,i getting Result from that meter through MY Arduino CODE, here I attached my code
but its is hex format i dont know how to convert in FLOAT32 format
i using your software for checking its working properly can you help me for this.
bcz i struggle last 30days for this.

Please Help ME.

thanks in advance

sketch_may28a.ino (1.4 KB)

Dear Team,

I need your support for my project Can you guide me
I m using ELMEASURE ELECTRICAL METER,I need to take a reading form that meter through RS485 ,i getting Result from that meter through MY Arduino CODE, here I attached my code
but its is hex format i dont know how to convert in FLOAT32 format
i using your software for checking its working properly can you help me for this.
bcz i struggle last 30days for this.

Please Help ME.

sketch_may28a.ino (1.4 KB)

@pitchaimuthufb, please stop cross-posting. Many threads merged.

I m using ELMEASURE ELECTRICAL METER,I need to take a reading form that meter through RS485 ,i getting Result from that meter through MY Arduino CODE, here I attached my code
but its is hex format i dont know how to convert in FLOAT32 format

Post a link to the manual/datasheet for your meter!
The ModBus standard doesn't know a float32 type, all registers are uint16 or bool. I guess the manual explains how they transform the float32 to probably two uint16 registers but as we don't have that manual we would have to guess.