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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
Is your port 502 free of use before codesys runtime starts ? (netstat -at may help)
yes, it is.
This because if I configure it as a master with a device attached it works normally without problem.
That's a wrong statement. Master may use any port.