Siemens S7 to Modbus TCP

boneless

Lifetime Supporting Member + Moderator
Join Date
Feb 2008
Location
OKC
Posts
1,628
Hi all!

I have got a retrofit coming up. Currently we are using an old Beijer E1151 HMI, which will be replaced by a Siemens TP1500. We use the Beijer as a gateway to send some data by Modbus to a SCADA system.

PLC is a 313C with Lean ethernet interface.

I am looking for an affordable way of achieving the same functionality, we have used Anybus in the past (Can set Lean as PROFNET device, ANYBUS as controller).

Wondering if there are other possibilities/products you guys can recommend?
 
Hi all!

I have got a retrofit coming up. Currently we are using an old Beijer E1151 HMI, which will be replaced by a Siemens TP1500. We use the Beijer as a gateway to send some data by Modbus to a SCADA system.

PLC is a 313C with Lean ethernet interface.

I am looking for an affordable way of achieving the same functionality, we have used Anybus in the past (Can set Lean as PROFNET device, ANYBUS as controller).

Wondering if there are other possibilities/products you guys can recommend?

Most affordable (no cost) would be to use modbus tcp and program it yourself using the function blocks for tcp/ip communication.
Look for SIMATIC Open TCP/IP Communication via Industrial Ethernet.

Another option that I don't recommend is siemens open modbus/tcp functions blocks. They suck IMHO. You need to pay for the license as well.

Another option is Siemens OPC server - Simatic NET OPC. Most SCADA systems can do OPC. The OPC server can access any DB inside the CPU. No programming needed for this option. Just configuration. There are two versions of the OPC server that I know of - one that supports up to 8 CPU's and the other that support's up to 32.

Another option might be to see if you have S7 communication support in the SCADA system. Then the SCADA can talk directly to the S7 CPU through the ethernet interface. Nothing is required at the Siemens end for this to work. But you'll probably need a S7 driver for the SCADA.

Another option would be to replace the CPU with S7-1200/1500 which I understand has built-in modbus tcp support. Haven't tried it myself yet though.

You could also do modbus communication through the Siemens panel but I don't think that's a good solution. Better to communicate with the PLC instead of the HMI. Might have some issues with who's going to be the master/slave as well for the panel / SCADA. Both would probably want to be set to master.
 
Last edited:
Hi!

Thanks for the reply. Do you have any examples, or do you know where I can find them, for the modbus using Simatic Open TCP/IP?
I have looked into the S7 Modbus blocks before and I agree (plus they are incredibly expensive).
 
Quick update, turns out the Comfort HMI can be used as a Modbus Master too. So I just added a connection, and wrote a simple VB script to transfer variables from my S7 side to the Modbus side.

Still interested in those examples tho :).

Thanks!
 
No, sorry.

But the principle is simple.

If the PLC is the master (called "client" in modbus tcp):

  1. Open connection
  2. Put together a modbus message (for instance request data)
  3. Send the modbus message
  4. Wait for reply
  5. Check out the reply and do what you need with it (for instance put the data in the proper place)
  6. Repeat forever
If you don't get a reply after a while, you have to restat the connection and try again.


If the PLC is the slave (called server in modbus tcp):

  1. Open connection
  2. Wait for a modbus request message
  3. Check out the message and decide what to do (read/write etc)
  4. Put together a reply message
  5. Send the reply
  6. Go back to waiting again (number 2)


There are function blocks to open and close a connection and there are blocks to send and to receive messages.
The messages you send are tcp messages, which is a block of data that goes to some ip address. If you put the modbus data in there you have a modbus tcp message. You need to go to modbus.org and down load how the modbus tcp messages looks.


Also a good idea to use a modbus tcp communication program on your PC. That way you can see exactly what bytes are sent and how the response looks.
 
Last edited:
Thanks Pete!

I will check that out. Never did much with creating custom messages, but love to learn :).
 
Thanks Pete!

I will check that out. Never did much with creating custom messages, but love to learn :).

It's not complicated really. I use SCL for stuff like this.

It's just having big case statement that works like a sequence goes on repeat.
In each step you put values in a DB or read from them or wait for something.
 
Quick update, turns out the Comfort HMI can be used as a Modbus Master too. So I just added a connection, and wrote a simple VB script to transfer variables from my S7 side to the Modbus side.

Still interested in those examples tho :).

Thanks!

So the old HMI was master and the SCADA slave? That's surprising as usually SCADA systems want to be masters.
 
Well, there might be another PLC in between us and the SCADA.

This system was originally delivered in 2010, I can't recall the exact details. But the driver in the old HMI is set as Modbus master.

Thanks for the help Pete, I appreciate the effort on your day off (hopefully :) )
 
Glad you got things sorted out. That's a pretty impressive data chain, to go from PLC 1 to HMI to PLC2 to SCADA.

Another option is Siemens OPC server - Simatic NET OPC. Most SCADA systems can do OPC. The OPC server can access any DB inside the CPU. No programming needed for this option. Just configuration. There are two versions of the OPC server that I know of - one that supports up to 8 CPU's and the other that support's up to 32.

The Comfort Panels can also be set as OPC Servers (I think OPC clients as well), so you don't need the Simatic Net license for any data in the HMI.
 
I do agree, one of those situations where something that was nice to have during start-up, turned into a necessity after several years of operation.

The idea was to trend/log some status bits, analog values and alarms. The SCADA is a proprietary piece of software, not sure if it can only talk to the suppliers PLC or what.

OPC might be solution as well, but for now we are just trying to replace the existing solution, without having to mobilize this 3rd party.

Thanks for all the help guys, you are the best :)
 
The Comfort Panels can also be set as OPC Servers (I think OPC clients as well), so you don't need the Simatic Net license for any data in the HMI.

Something to add, in response to a PM:

I don't believe it acts as a gateway to ALL tags in the PLC, just the HMI tags you've created, which may happen to be linked to your PLC.
 

Similar Topics

Hello All, For S7-400H system, can we make this redundant PLC (connected to one uplink switch) to communicate simultaneously with 3rd party HMI...
Replies
2
Views
1,516
I have a system with an ET200SP controlling a Profinet network already pre-established. Am I correct in that I can add a Modbus TCP/IP node and...
Replies
2
Views
1,943
Hello All, I am not very familiar with the Siemens architecture however, I was looking into a possible application. The current Siemens PLC is...
Replies
9
Views
4,270
Hi All, I have a closed loop stepper motor (Nanotec make), https://en.nanotec.com/products/2512-pd4-e601l42-e-65-4. This uses MODBUS TCP for...
Replies
4
Views
3,978
Hello; i'm having some troubles with a com test i'm handling. i have another end for it, but for now i would like to have : M241 in io_scanning...
Replies
4
Views
3,550
Back
Top Bottom