s7-1200 slave with two masters (modbus TCP)

rQx

Lifetime Supporting Member
Join Date
Oct 2010
Location
Trelleborg
Posts
1,051
Hi,
I currently have a s7-1200 enabled as modbus tcp slave for customers master to connect to freely. Now my customer want to add a new modbus master device to connect to the same s7-1200. It will connect to a new datablock in the s7-1200 but as I see it the issue is that there will be 1 slave and 2 masters on the network. How do we solve this?
/Tim
 
Hi,
I currently have a s7-1200 enabled as modbus tcp slave for customers master to connect to freely. Now my customer want to add a new modbus master device to connect to the same s7-1200. It will connect to a new datablock in the s7-1200 but as I see it the issue is that there will be 1 slave and 2 masters on the network. How do we solve this?
/Tim

I don't use S7 but if its Modbus TCP you should be able to have multiple masters, unless the S7 has some weirdness to stop that happening.
 
As it is TCP MB, you need on 1200 same configuration on as for TCP1 DB block

Change for new block was at least
IP = Master2 IP.
DB block = new db
Port =502 and new instance for coms.
Else?

Coms are from different IPs so thinking that you can use same 502 port for both.

If you try to communicate 2 different DBs from same ip then cpu needs different port number as DB blocks don't know to which DB is asked from 502.
(DB blocks go mixed and you get wrong values...)

Only one DB/IP/port
 
Here is manual.

https://cache.industry.siemens.com/...95681/v1/s71200_system_manual_en-US_en-US.pdf


You need to look page 1186 (Note that this is older manual, as it explains little bit more than newer manual)


There is Note onn page 1182 (Which is also on newer manual):


Multiple server connections
(1200, not sure about 1500CPU)

-Each MB_SERVER connection must use a unique instance DB.
- Each MB_SERVER connection must assign a unique IP port number.

- Only 1 connection per port is supported.
- Each MB_SERVER connection must assign a unique connection ID.
- The MB_SERVER must be called individually for each connection (with its respective instance DB).


On example on page 1186 and how I understand this, you need different TCP ports for every communication on PLC as Server.
Max number for multiple coms on 1200 was 4 or 8 depending of FW?


I don't use S7 but if its Modbus TCP you should be able to have multiple masters, unless the S7 has some weirdness to stop that happening.

Hopefully rQx can change modbus 502 port on PC side for 503 or something else, as changing port is not option on all softwares.

(And if you can't, then you need reprogram 502 port to different on switch or different routing program between your scada and PLC.)


But it is Siemens, nothing new o_O (y)

All coms should use 502 port as Schneider / Modicon PLC do without need of different ports for every communication.




p.s It is maybe possible that you use one DB and port 502, but then have multiple communications same time to this DB / port 502.

But manual says it differently on this

"Only 1 connection per port is supported."
 
Last edited:
The real problem is how do you handle the case where two masters write to the same location at the same time or what happens in a read modify write situation?

I will have two diffrent datablocks for the two mb_server and the mb_server block doesnt allow multiple connevtions to it.
 

Similar Topics

What is the best practice way to make remote procedure calls from a Siemens s7-1200 PLC to a C# app running on a PC (app is directly controlling...
Replies
1
Views
1,219
I am just getting information about a need that a site has. They currently have a machine that has a ML1200 and is being interfaced to by a...
Replies
16
Views
6,697
I am trying to get Siemens 1214c dc/dc/dc cpu work as a Modbus RTU slave with RS232 communication module. As a master i have PC. I tried to get...
Replies
3
Views
3,647
Hello I'm trying to Connect ABB IRC5 controller using profinet to Siemens S7-1200 PLC The PLC is the master and IRC5 is the salve. The IRC5 has 2...
Replies
0
Views
8,359
Hello people.Thank you in advance. Below is a java application which I try to communicate my java application with ml 1200 through the Modbus...
Replies
0
Views
3,842
Back
Top Bottom