Posts: 87
Threads: 13
Joined: Oct 2015
Reputation:
6
Hi
I am updating my scripts to use grp.checkwrite instead of my own wrapper that simply wrote things in memory and then did a string compare to prevent unnecessary bus load
so far I have the following experience
- booleans it seems to work fine
- floats only works fine, if I add the delta argument at the end for example grp.checkwrite(KNXGROUP, newValue, 1)
but why is this needed ?
in my opinion it should have a default behaviour if there is a difference then write to the bus
- text does not work fine ? grp.checkwrite(KNXGROUP, newValue, 1)
It always writes the newValue to the bus ? How can I prevent this with grp.checkwrite ?
For now I use my own wrapper again for this
Thanks
Nicky
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
It only supports numeric and boolean data types, for other data types it behaves the same as grp.write. If no delta is set values must have an exact match. This might not always work for floating point values due to their internal representation so it is recommended to set delta for floats.
Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
Hi Admin
Could you please add "feedback" argument? I mean
grp.checkwrite(target_group, newValue, delta, test_group)
Because sometimes I want to change the value only in case fedback value doesn't match to newvalue.
Delta is important in case you work with 5.001 scale (integer percents) and its crappy implementation in KNX.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 87
Threads: 13
Joined: Oct 2015
Reputation:
6
Thank you for the clarification
Could you add in a future release a default implementation like a string compare for unsupported datatypes?
Thanks
Nicky
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
Support for status object and non-boolean/numeric datatypes will be added in the next firmware.
Posts: 33
Threads: 8
Joined: Jul 2015
Reputation:
0
how was this implemented for non boolean/numeric? What does it dop with the 3rd argument?
I ask, because in the FB editor, checkwrite is only inserted as code if an argument is provided. For numeric a 0 or delta is clear.
But how does is behave on string for instance?
Does it ignore the 3rd argument?
How to configure FB editor output to have a checkwrite without 3rd argument for string (I tried typing nil, but not accepted)
thx
C.
Don't ask what we can do in KNX but wonder what we can't - www.KNXlogic.eu
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
Minimum delta (3rd arg) works only for numeric data types, it is ignored otherwise. Checkwrite can also compare tables for date/time types. Strings are just checked for equality.
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
Hi
Log value and see what you get there.
BR
------------------------------
Ctrl+F5
Posts: 4643
Threads: 24
Joined: Aug 2017
Reputation:
207
------------------------------
Ctrl+F5
Posts: 411
Threads: 103
Joined: Oct 2016
Reputation:
9
Hi
How about 3rd parameter as a callback function with two arguments returning boolean? It would be universal and pure Lua way solution.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
For which types do you need this?