12-29-2024, 08:02 PM
I have my code built from your examples with added the modbus tcp server ontop.
The only difference between mine and yours was the delay in the void loop(). Adding the delay to mine code bellow all the digital writes fixed it. Plotting the value for 100 seconds (1000 samples), it never changes from the actual value.
So lesson learned: do not let the cpu poll the IO expander at full speed.
Another question I wanna ask, in the KCS firmware, is it normal to use Modbus-HA for RS485? Lacking the TCP modbus option, I havent used the KCS firmware too much, but when testing with a usb>serial adapter, only Modbus-HA seemed to work.
The only difference between mine and yours was the delay in the void loop(). Adding the delay to mine code bellow all the digital writes fixed it. Plotting the value for 100 seconds (1000 samples), it never changes from the actual value.
So lesson learned: do not let the cpu poll the IO expander at full speed.
Another question I wanna ask, in the KCS firmware, is it normal to use Modbus-HA for RS485? Lacking the TCP modbus option, I havent used the KCS firmware too much, but when testing with a usb>serial adapter, only Modbus-HA seemed to work.