Logic Machine Forum
Modbus dt.float16 - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Modbus dt.float16 (/showthread.php?tid=4393)



Modbus dt.float16 - Rauschentofft - 22.11.2022

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)



RE: Modbus dt.float16 - Daniel - 23.11.2022

Try this version
https://forum.logicmachine.net/showthread.php?tid=4288&pid=27726#pid27726


RE: Modbus dt.float16 - Rauschentofft - 06.03.2023

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


RE: Modbus dt.float16 - Daniel - 07.03.2023

The script and library was corrected to correctly handle float16 objects.


RE: Modbus dt.float16 - Rauschentofft - 11.03.2023

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.


RE: Modbus dt.float16 - Daniel - 13.03.2023

Did you update the script too? There are some changes in it too, not just library.


RE: Modbus dt.float16 - Rauschentofft - 14.03.2023

Hi
i used the script from this link you asked me to try.

https://forum.logicmachine.net/showthrea...6#pid27726


RE: Modbus dt.float16 - Daniel - 15.03.2023

Post your full script.


RE: Modbus dt.float16 - Rauschentofft - 15.03.2023

Here is my scripts.


RE: Modbus dt.float16 - admin - 16.03.2023

You haven't updated the user library. Copy the latest code from here: https://forum.logicmachine.net/showthread.php?tid=4288&pid=27726#pid27726