Typecasting operation

I am using Nodemcu for coding purpose. I need method of read data in correct format. I have connected modbus output to nodeMCU .

I could able to read response from salve device . only need to do typecast result.
the output i used to 32bit floating type. How can i convert these value to float type

when i change the value to unsigned Decimal showing properly . But i need to display value in 32 bit floating point

example code

// Define one address for reading
#define address 1
// Define the number of bits to read
#define bitQty 70

void setup()
{
  Serial.begin(9600);
  // Initialize Modbus communication baud rate
  node.begin(9600);


}

void loop()
{

  int result =  node.readHoldingRegisters(address, bitQty);
  data[0] = (float) node.getResponseBuffer(0);
  data[1] = (float)node.getResponseBuffer(1);
  data[2] = (float)node.getResponseBuffer(2);
  data[3] = (float) node.getResponseBuffer(3);
  data[4] = (float) node.getResponseBuffer(4);
  data[5] = (float)node.getResponseBuffer(5);
  for (int i = 0; i < 100; i++)
  {
    //data[i] = node.getResponseBuffer(i);
    Serial.println(data[i]);
  }
  Serial.println("............");



}

If from node is coming as int then how you gonna cast to float?
Example:
Byte 5
Casting to float will be 5.000000 .

that means i convert those value to float.The result i m getting unsigned decimal are same. cant it be converted to float.

You are reading back 16 bits so you need to put them into a structure:
Note: b1 and b2 are the first two values in your array

uint16_t b1 = 6345;
uint16_t b2 = 16968;

struct u32_t {
  uint16_t hi;
  uint16_t lo;
};

union example
{
  u32_t i;
  float f;
};

union example u;

void setup() {
  Serial.begin(9600);
  while( !Serial );

  u.i.hi = b1;
  u.i.lo = b2;
  printit();
}

void loop() {
}

void printit() {
  Serial.print( "b1 = 0x" ); Serial.println( b1, HEX );
  Serial.print( "b2 = 0x" ); Serial.println( b2, HEX );
  Serial.print( "hi = 0x" ); Serial.println( u.i.hi, HEX );
  Serial.print( "lo = 0x" ); Serial.println( u.i.lo, HEX );
  Serial.print( "float = " ); Serial.println( u.f );
}

Ok i think you didnt get it.

You are getting from node lets say int 6.

Casting to float will be the same 6 with zeros after point.

So now float variable or array element in your case which contains 6 is float. And value inside is 6.0000...

uint16_t getResponseBuffer(uint8_t);
This from your modbus library.

What your expect to see?

The modbus library its using might be giving 8 bit register value. if we writing our own code i could save my value like in format #3 then combine and display parameter.But here library developed by 3rd party & its working well.only

in this format

uint16_t getResponseBuffer(uint8_t);

I wanted to get result in

float format.So that i could display my result like atleast in modscan32 format
that means i need to change the library then??
double getResponseBuffer(float);

Is there any library which give out output in floating point