Hello
We are using Codesys V 3.5.10.50 on Raspberry PI model 3 to communicate with a Modbus RTU device through a Modbus TCP gateway.
In the Slave configuration, itΒ΄s possible to define the Unity-ID address, besides the IP address and IP port of the TCP Gateway.
However, the library only allows us to change the IP addresses and port, using the TCP-Slave.ComSettings function.
Is there any way to swap Unity-ID via program???
Sergio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need the same issue. In my application TCP server on raspberry (codesys) should have UnitID 1. But it only works when I am requesting with UnitID 255. And my application can't work with this parameters...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please explain how you configured that. Normaly, the Server should answer to all UID as long as gateway isn't activated. With activated gateway all UID will be forwarded to Serial-Interface, in taht case 255 has to be used for Gateway-Diagnostics.
So that means, there is somethink wrong on your configuration.
Which CDS-Version, Which Runtime-Version and so on are used.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My codesys is 3.5.21.30. I am using function ModbusServer from library ModbusTCP_Slave. The reason is that I need share 9000 Holding registers. By standard configuration it is only 4096.
Ethernet port is cofigured:
Network interface: eth0
IP address: 10.10.22.55
Subnet maskL 255.255.255.0
Default gateway: 0.0.0.0
And it only works when I am reading registers with ID 255 by Modbus Poll. Any other IDs don't work. The actual TCP client device try to read registers with ID 1 and I can't change it...
Thanks in advance for your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey Husarz,
thanks for your Message, now i understand your Problem, also able to reproduce that. Pls. give me a Short Time to Check some stuff on this, i'll come back to this Topic with news ASAP.
Greetings
Last edit: nulltrace 2026-04-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i don't forget you, the Thing is, to give you my answer, i have to wait for Answer from Codesys/E. Schwellinger. i suspect Mr. Schwellinger is on in Vacations that week.
so please, be patient at moment
Last edit: nulltrace 2026-04-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
We are using Codesys V 3.5.10.50 on Raspberry PI model 3 to communicate with a Modbus RTU device through a Modbus TCP gateway.
In the Slave configuration, itΒ΄s possible to define the Unity-ID address, besides the IP address and IP port of the TCP Gateway.
However, the library only allows us to change the IP addresses and port, using the TCP-Slave.ComSettings function.
Is there any way to swap Unity-ID via program???
Sergio
I would also like to know how this can be achieved.
V3.5.11.0
John
Did you ever find a solution to this? I am looking to perform the same thing.
I need the same issue. In my application TCP server on raspberry (codesys) should have UnitID 1. But it only works when I am requesting with UnitID 255. And my application can't work with this parameters...
Please explain how you configured that. Normaly, the Server should answer to all UID as long as gateway isn't activated. With activated gateway all UID will be forwarded to Serial-Interface, in taht case 255 has to be used for Gateway-Diagnostics.
So that means, there is somethink wrong on your configuration.
Which CDS-Version, Which Runtime-Version and so on are used.
My codesys is 3.5.21.30. I am using function ModbusServer from library ModbusTCP_Slave. The reason is that I need share 9000 Holding registers. By standard configuration it is only 4096.
Ethernet port is cofigured:
Network interface: eth0
IP address: 10.10.22.55
Subnet maskL 255.255.255.0
Default gateway: 0.0.0.0
And it only works when I am reading registers with ID 255 by Modbus Poll. Any other IDs don't work. The actual TCP client device try to read registers with ID 1 and I can't change it...
Thanks in advance for your help!
Hey Husarz,
thanks for your Message, now i understand your Problem, also able to reproduce that. Pls. give me a Short Time to Check some stuff on this, i'll come back to this Topic with news ASAP.
Greetings
Last edit: nulltrace 2026-04-03
Hey Husarz.
i don't forget you, the Thing is, to give you my answer, i have to wait for Answer from Codesys/E. Schwellinger. i suspect Mr. Schwellinger is on in Vacations that week.
so please, be patient at moment
Last edit: nulltrace 2026-04-10
Hi nulltrace,
Thanks for the info. I'm waiting to hear back from you.
Take care!
Hey, I also waiting for feedback from Mr. Schwellinger
@eschwellinger, please send me an answer, i would appreciate it.
The clue is, i know the solution, but have to check if it's allowed to share.