how to get modbus register in float ?

Hi....
i am trying to get modbus float data on arduino uno. I get integers value but I do not get float value so what can i do to get modbus float value in arduino uno? plese help me anybody know.

thanks all

what can i do to get modbus float value in arduino uno?

Write the proper code. If you don't know how, post the code you have now, links to the libraries you are using, and some details (links) about the device you are trying to get floats from.

Hi.............

thanks to give answer i attached data sheet of elmeasure meter whose gives data on rs485 i am using

mod_lgplus.pdf (18.6 KB)

i am using

Nonsense. Post ALL of your code.

hi

So, that code sends 8 bytes to the device. It then waits 1/10th of a second, and then reads, one byte at a time, storing the byte in a long variable with the stupid name byteReceived, and then printing the byte.

Given that a float is 4 bytes, and that there is nothing in the code you posted that even remotely looks like it would be dealing with a float, I fail to see what your problem is.

thanks to reply

how to add in the code to get float data in the arduino if you have any idea how to edit my code please help me

how to add in the code to get float data in the arduino if you have any idea how to edit my code please help me

You need, first, to send a command that results in a float being returned, as 4 bytes.

You need, second, to create a union between a float and a 4 element byte array.

You need, third, to read the four bytes from the serial port, as they become available (or, after assuring that there are 4 bytes ready to be read) and store them in the byte array part of an instance of the union.

Then, the float part of the instance of the union is the float that you want.

Part 2:

union jack
{
   float f;
   byte b[4];
};

Part of part 3:

jack off;
if(Serial.available() >= 4)
{
   for(byte b=0; b<4; b++)
   {
      off.b[b] = Serial.read();
   }

   // off.f contains the float value
}

thanks
i am trying but i do not get float value. so help me

i am trying

You really are.

Where is your code?