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

Modbus Slave configuration problem on port 502

mikeardy
2018-12-14
2018-12-17
  • mikeardy - 2018-12-14

    Hi,

    I'm configuring a communication channel in ModbusTCP. The Raspberry Pi must act like a slave and another PLC will be the Master.
    I assigned the right IP address for each partner and the standard port 502 for the Modbus.
    Why if I set 502 as a port in Codesys the bus does not work and if I set 503 does it work?
    I need it to be 502 because the master can't change the port for the slave.
    How can I solve the problem?
    (see picture in attachment)
    thank you

    IMG: modbus port 502.JPG

    IMG: modbus port 503.JPG

     
  • dFx

    dFx - 2018-12-14

    Is your port 502 free of use before codesys runtime starts ? (netstat -at may help)

     
  • mikeardy - 2018-12-17

    yes, it is.
    This because if I configure it as a master with a device attached it works normally without problem.

     
  • dFx

    dFx - 2018-12-17

    That's a wrong statement. Master may use any port.

     

Log in to post a comment.