22.11.2021, 07:07
You can use a script instead. But all communication (reading and writing) should be in a single resident script. Otherwise the communication can fail randomly if LM tries to read and write at the same time. If you need to read many objects at once you can use bacnet.scandevice():
https://forum.logicmachine.net/showthrea...7#pid22457
Since instant reaction is not needed for AC units you can do it like this:
- Read current values from the AC unit, update status objects if needed
- Compare status values with current control values in LM objects, write back to BACnet if values are different
Keep in mind that setpoint values might have a slight difference due to how floating point numbers and handled so direct comparison might not work, use this:
https://forum.logicmachine.net/showthrea...7#pid22457
Since instant reaction is not needed for AC units you can do it like this:
- Read current values from the AC unit, update status objects if needed
- Compare status values with current control values in LM objects, write back to BACnet if values are different
Keep in mind that setpoint values might have a slight difference due to how floating point numbers and handled so direct comparison might not work, use this:
Code:
if math.abs(control - status) > 0.1 then
write()
end