This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Convert int16 to float16
#1
Hi!

I'm working on with special modbus script. 
I have Corrigo ventilation controller and communicating over ModbusRTU. When I read register with profile then it is converted automatically thanks to this line:

{ "name": "Outside temp", "bus_datatype": "float16", "datatype": "int16", "type": "inputregister", "address": 0, "value_multiplier": 0.1, "units": "C" },

So this works.

Now I'm going to use scripting. How can I convert integer to float via script?

For example, received value is 65523, it should be -1.x degree.
Reply


Messages In This Thread
Convert int16 to float16 - by fleeceable - 28.02.2020, 13:23
RE: Convert int16 to float16 - by Daniel - 29.02.2020, 09:24
RE: Convert int16 to float16 - by fleeceable - 02.03.2020, 14:26
RE: Convert int16 to float16 - by admin - 02.03.2020, 07:42
RE: Convert int16 to float16 - by Daniel - 02.03.2020, 15:33
RE: Convert int16 to float16 - by fleeceable - 02.03.2020, 16:58
RE: Convert int16 to float16 - by admin - 02.03.2020, 15:52
RE: Convert int16 to float16 - by Daniel - 02.03.2020, 17:10
RE: Convert int16 to float16 - by admin - 02.03.2020, 19:03

Forum Jump: