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.

Modbus dt.float16
#1
Hi.

Is it possible to not round the value of dt.float16?

Would like to have one decimal. ex. 20,1

Temp is 19.6°C in the room, Read value in duc 20°C.


See script
.txt   NEW_Modbus slave handler.txt (Size: 3.51 KB / Downloads: 14)
Reply
#2
Try this version
https://forum.logicmachine.net/showthrea...6#pid27726
------------------------------
Ctrl+F5
Reply
#3
Hi,

I have know tried the script and only the first register is showing the right value.
all the values after the first register is showing wrong values.

Have you seen this problem before?

registers = {
      [0] = '2/1/1',  actual value knx 20,9 and in the DUC 20,9
      [1] = '2/1/2',  actual value knx 21,4 and in the DUC 30,6
      [2] = '2/1/3',  actual value knx 20,1 and in the DUC 30,2
      [3] = '2/1/4', and etc, etc
      [4] = '2/1/5',
      [5] = '2/1/6',
      [6] = '2/1/7',
      [7] = '2/1/8',
    }

//Martin
Reply
#4
The script and library was corrected to correctly handle float16 objects.
------------------------------
Ctrl+F5
Reply
#5
When i used the New slave handler script i would get the right temp without the decimal.

But now ill dont get the right temp only the first register is right. All after register 0 is showing about 10 degreed more. I'll have about 30 registers.

The temp is a knx sensor and i send the values from
knx to Duc.
Reply
#6
Did you update the script too? There are some changes in it too, not just library.
------------------------------
Ctrl+F5
Reply
#7
Hi
i used the script from this link you asked me to try.

https://forum.logicmachine.net/showthrea...6#pid27726
Reply
#8
Post your full script.
------------------------------
Ctrl+F5
Reply
#9
Here is my scripts.

Attached Files
.txt   New Library Script Modbus TCP 2022-12-11.txt (Size: 10.53 KB / Downloads: 5)
.txt   New Resident Script Modbus TCP 2022-12-11_.txt (Size: 1.33 KB / Downloads: 3)
Reply
#10
You haven't updated the user library. Copy the latest code from here: https://forum.logicmachine.net/showthrea...6#pid27726
Reply


Forum Jump: