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.

Universal Modbus TCP/RTU Slave
#61
(26.02.2024, 09:08)Daniel Wrote: This is how it meant to work. You need to convert it back to float on master device.
mb.setfloat16precision(2) sets how float16 is converted to integer. By default it's 2 decimals (0.01 precision). Change 2 to 0 to convert to integer without any decimals.

Hi! Yes, it works. Not a big problem to convert back to float on master device, but just to clarify. Is it possible to make pure float register (either it can be little or big endian)?
Reply
#62
float32 data type is handled as is without any conversion. The script can be modified to convert float16 to float32 instead of int16.

Edit: script has been updated with optional conversion of float16 to float32: https://kb.logicmachine.net/integration/...tcp-slave/
Reply


Forum Jump: