Activity Forums Questions & Troubleshooting Software & Firmware Official Arduino Modbus RTU library and Controllino Mega

  • Official Arduino Modbus RTU library and Controllino Mega

     Sonary updated 1 year, 6 months ago 3 Members · 4 Posts
  • uskok

    Member
    July 24, 2019 at 9:17 am

    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 (https://www.controllino.biz/knowledge-base/rs485-modbusrtu/) is working, but I would like to avoid mixing of two different libraries. We are already using official version Arduino Modbus TCP.

    Has anyone encountered this problem and managed to solve it?

    Thanks in advance,

    Uskok

  • Lukas

    Member
    August 9, 2019 at 12:32 pm

    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

  • uskok

    Member
    August 20, 2019 at 2:52 pm

    Thanks, it is working.

  • Sonary

    Member
    June 14, 2023 at 1:47 am

    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?

Viewing 1 - 4 of 4 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now