10.02.2022, 17:09
(This post was last modified: 10.02.2022, 17:47 by jeroen@stevens.biz.)
(10.02.2022, 08:25)admin Wrote: Try using multiple register write instead:
Code:value = 4 -- bit 2 set to 1
res, err = mb:writemultipleregisters(33471, value)
log(res, err)
I get this output now:
* arg: 1
* number: 1
* arg: 2
* nil
I see the alarms are reset this way. Thanks.
(10.02.2022, 07:48)Erwin van der Zwart Wrote: Hi,
You can use your setbit script but instead of writing direct to modbus by script you should write the output value of your script to a virtual object and use the modbus template mapped to this virtual object.
Hi Erwin,
The reset works with the writemultipleregisters in the script. Now I want to move on to the profile way as you suggested.
1/ Is it sufficient to add to the modbus profile something like this:
{
"name": "reset flow error (err 20)",
"bus_datatype": "int16",
"datatype": "int16",
"type": "register",
"address": 33471,
"writable": 1,
"value_bitmask": 0x4
}
and then link that to a virtual object?
2/ I've set the polling interval of that device to 55 seconds. Is then the value of the object written to the device every time? I'm asking because now I use a script to write values, but only when they change (like the setpoint for the cooling depending on the dewpoint).
Greets