Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Pi Modbus RTU

camo
2021-06-14
2021-06-16
  • camo - 2021-06-14

    Hi all. Pretty new to all this and trying to get a Pi running Codesys talking to an Arduino Nano using Modbus RTU. Have used the following post for reference but am failing.

    https://forge.codesys.com/forge/talk/Runtime/thread/634eb0e582/?limit=25#0f41

    The Arduino code/libraries seem to have changed but have used the new one and the example advanced_slave code from it here

    https://github.com/smarmengol/Modbus-Master-Slave-for-Arduino

    The pi is online but Modbus master and slave have red triangles next to them in device tree and slave states 'not running' . Tried different USB ports.

    If anyone has any pointers or better examples that'd be appreciated.

    Thanks

     
  • camo - 2021-06-16

    Well.... Good news is I got it working with some other code however have the same problem mentioned in a few other places regarding the connection not restarting if lost. I can unplug the Arduino and re-plug but it never reconnects. Using the auto-reconnect checkbox 'ON,' causes it to never work in the first place and results in a flashing re/orange triangle next to the slave.

    Anyone know a way to reset the modbus master?

     

Log in to post a comment.