title: MODBUS-tk Read floating point values from slave in the master
body: <p>I have created modbus slave to write data to the registers.
  I am able to write both float values and integer values from the slave side.</p>
  
  <p>In the modbus master I am able to access only the integer values but not able to read float values.</p>
  
  <p>I went through this <a href="https://github.com/ljean/modbus-tk/issues/72" rel="nofollow noreferrer">https://github.com/ljean/modbus-tk/issues/72</a> but that didn't solve my problem.</p>
  
  <p>For the integer values reading I can use the below code and read the values.</p>
  
  <pre><code>master = modbus_tcp.TcpMaster()
  master.set_timeout(time_out_period)
  result = master.execute(slave = 100, function_code = 3 , starting_address = 0, quantity_of_x = 25) 
  </code></pre>
  
  <p>But for the float values I used both the above and below code.</p>
  
  <pre><code>master = modbus_tcp.TcpMaster()
  master.set_timeout(time_out_period)
  result = master.execute(slave = 100, function_code = 3 , starting_address = 0, quantity_of_x = 25 , data_format='&gt;f') 
  </code></pre>
  
  <p>I get error while reading the float as,</p>
  
  <blockquote>
    <p>unpack requires a bytes object of length 4</p>
  </blockquote>