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.
In the modbus master I am able to access only the integer values but not able to read float values.
I went through this https://github.com/ljean/modbus-tk/issues/72 but that didn't solve my problem.
For the integer values reading I can use the below code and read the values.
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)
But for the float values I used both the above and below 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='>f')
I get error while reading the float as,
unpack requires a bytes object of length 4