MichielVanwelsenaere/HomeAutomation.CoDeSys3

Implement failsafe timer on RS485 buscontroller

Closed this issue · 1 comments

Although I've been using the implementation of the RS485 buscontroller for quite some time I recently ran into an issue where the controller got into an invalid state. This happened during the testing of some new RS485 hardware. A possible cause might be an improper implementation of the standard on the tested device.

To avoid the RS485 buscontroller getting in this invalid state (which blocks all further RS485 traffic) it's a good idea to implement a failsafe timer that marks the RTU query is failed after a certain time and moves on to the next device.

In addition to the above the RS485 buscontroller would also benifit from a 'linked list' implementation instead of the current array implementation with RS485 devices. A linked list would allow to iterate over the devices sequentially starting from the device that last leveraged the bus. This instead each time of iterating over the entire collection from position 0. A user has provided an implementation with this approach:

buildingautomation_v6.zip