Activity › Forums › Questions & Troubleshooting › Software & Firmware › Official Arduino Modbus RTU library and Controllino Mega
-
Official Arduino Modbus RTU library and Controllino Mega
-
Hi, I have problem with official Arduino Modbus RTU library (
https://www.arduino.cc/en/ArduinoModbus/ArduinoModbus )Inside Library, at the end of the file RS485.cpp, instance of RS485 class is initialized.
Code:RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS845_DEFAULT_DE_PIN, RS845_DEFAULT_RE_PIN);
This is not fit with hardware inside Controllino Maxi or Mega. I tried to change the initialization to
Code:RS485Class RS485(SERIAL_PORT_HARDWARE3, CONTROLLINO_UART_TX, CONTROLLINO_RS485_DE, CONTROLLINO_RS485_nRE);
But without success.The tutorial and library from Controllino web site (
) is working, but I would like to avoid mixing of two different libraries. We are already using official version Arduino Modbus TCP.https://www.controllino.biz/knowledge-base/rs485-modbusrtu/ Has anyone encountered this problem and managed to solve it?
Thanks in advance,
Uskok
-
Hi, I think that you have done only one small mistake – please try to replace
Code:CONTROLLINO_UART_TX
with
Code:CONTROLLINO_RS485_TX
.
And it is also necessary to add
Code:#include
at the top of the RS485.cpp.
I will try to prepare the setup and test it here also.
Good luck!
Lukas
-
Could you paste all the modifications required for the ArduinoModbus library to make it work for a Controllino board.
I didn’t understand the part
” #include
-at the top of the RS485.cpp”
Which library should be included at the top of RS485.cpp?
Log in to reply.