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

RPi's as both Master + Slave Modbus TCP/IP

Anonymous
2017-10-19
2017-10-22
  • Anonymous - 2017-10-19

    Originally created by: Primitive Source

    Hello,

    I'm sure this can be done, I just need a point in the right direction.

    I would like to have have 1 Raspberry Pi as my Modbus master, so I open a raspberry pi project in Codesys at ethernet device and a slave channel. I have a couple of Modbus slaves bring back sensor data. I then run some calculation on the sensor data have a new value. I write the value to a Variable.

    Is there a way to set up a second Raspberry Pi as a Modbus slave, add this as a new slave in my project and write the new calculation variable to a modbus register? If so, is there any example code showing me how to do this?

    I can find a lot about setting up the Pi using pyModbus but nothing really describes what I am trying to do. This is the closest I can find to what I am trying t do but not sure if

    https://pymodbus.readthedocs.io/en/late ... erver.html

    thanks

     
  • Anonymous - 2017-10-22

    Originally created by: Primitive Source

    I have worked this out. You can add a Slave device under the main ethernet adaptor, take variables from my programme and pass these over modbus to be read by another programme.

     

Log in to post a comment.