Simatic S7 - Modbus Communication

mareki

Member
Join Date
Jun 2002
Posts
7
I have very BIG problem with Modbus communication between two Simatic PLC's.
I have made everything according to documentation, but communication is still wrong. Function P_SND_RK is returning error 1E0F. I can't find this error number in documentation.

Is anybody has an example (project for Step7 with Modbus communication)???

Best regards
MI
 
Mareki,

You are not very specific about the PLC's configuration.

However there is a web-site for MODBUS users:

www.modbus.org

Here you can find a discusion group for developers and users.
Maybe you can drop your question there to find an answer.

Good luck

With regards
Shoop
 
I was hoping someone would answer this post in some detail. I use a variety of Siemens including S7 200/300/400 but cant find any refence to using MODBUS with them, there standard is PROFIBUS or MPI.

I personally do not know what is needed to use Modbus but would like too for gp.
 
I found one error in my program, exactly in Send DB Source. I created single words as data, instead of array of words.
Now everything is great, and Modbus communication is running ok.

Best regards
MI
 
Glad I wasnt the only one that didnt understand how/why Modbus was used.

I just paid a small fortune for a pcmcia card to connect to all Siemens plcs..S5, S7 200 or 300. The adapters are different for all 3. The 300 uses either MPI or Profibus. The 200 uses something called PPI...at this moment I couldnt explain what that is. As Peter mentioned the way..ie ladder code...to use Modbus is not that simple.

As I stated before I found no references to using Modbus with Siemens S7...either 200 or 300/400. I am curious how its done. I may never DO it but you never know when a machine will show up that has been done for whatever reason.

My next question. Since Siemens has a prefered Profibus protocol what was your reason to connect to a Modbus network...I assume there were existing devices used that used Modbus?

The last isnt as important as the HOW but would be nice to know.
 
I have to use Modbus protocol, because I have to exchange data between S7 400 and DCS (ABB Symphony). Additionaly I have to connect Simatic S7-300 with DCS Honeywell (Simatic is slave), and with energy calculators (Danfoss) where Simatic is master.
I wrote about connection between two Simatic PLCs because I wanted to test this communication.

I don't use RS-232. I use CP 441-2 (S7-400) and CP341 (S7-300) with RS-485 interface. Additionaly I have to buy Modbus licence.
It isn't necessary to implement own Modbus protocol! Siemens sells functions (FB) which you can use to Modbus Communication.

Fortunately, I have managed this communication.
Communication is always problem for me :(

Best regards
MI
 
Hi every one..

I need to make one comunication between a Bentley Nevada 3300 and PLC S7, the Bentley Nevada 3300 have a Modbus comunication on SDI, and I want to comunicate with PLC S7 via ET200S and IM151, is the easy way or I need the CP 341 in some ET200M? :rolleyes:

I have very BIG problem with Modbus communication between two Simatic PLC's, I don´t now what I need to use for it..

Anybody has an example (project for Step7 with Modbus communication???

Thanks in advance ;)
 
I'm using modbus to communicate from an S7 to several GE Multilins. It was cheaper to do it this was as the profibus options on the multilins are about $1500 each. The modbus documentation is not very good at explaining what needs to be done. This and the fact that I'm new to Siemens is making this very painful.

Here's an example of how it's done. I don't know what the 'X' input is, but it's critical.
 
S7-300-Modbus slave

Is there anyone help to solve my problem.
I am new to siemens S7-300 and I want to setup RS485-Modbus communication link between Yokogawa Centum CS-3000 DCS and S-7 PLc. DCS as a Master and PLC as slave.
Do I need to write some type of communication code in plc?
I shall appreciate, if some one can send me step by step procedure to configure slave end.

Thanks

[email protected]
 
Red Lion has some communications bridges (DSP series) that will bridge between MPI or Profibus and Modbus. You simply map registers using their software and let it rip. Definitely the way to go.
 
Toms suggestion definitely sounds as the easiest way to go.

I shall just mention that there are two other alternatives:
A CP341 communications processor in the S7-300 rack + a loadable driver for Modbus.
Here is the manual for CP341 + modbus driver solution:
http://support.automation.siemens.com/WW/view/en/25380100

Or, if you happen to use the ET200S distributed i/o on Profibus, then there is a dedicated module to put in an ET200S rack.
As far as I have heard the max baudrate with this module is 19200.
It is much less expensive than the CP341 solution though.
Here is the manual for the ET200S 1SI solution:
http://support.automation.siemens.com/WW/view/en/9260793
 
One for ControlLogix ladder

Peter Nachtwey said:
S7-300s don't have RS-232 ports. S7-200 can use freeport and implement Modbus. Implementing Modbus or any protocol in ladder code is not easy.

Rockwell has an implementation for Modbus -- one for a master, one for a slave -- written in ladder for their ControlLogix family. It can be downloaded off their website. As I recall, it was RTU only, no ASCII, and I think it was only a subset of Modbus, but they have a PDF document that describes its functionality. The ControlLogix port is RS-232C, so you need a converter to connect to RS-485 for Modbus.

I used the Modbus Master code. The PDF has inconsistencies with the actual ladder logic and type defs. Fortunately, the ladder code seems to work. The PDF talks about byte swapping to deal with endian issues, but the ladder doesn't seem to do this. (This is good because when I looked at it, it appeared that Modbus and ControlLogix were the same-endian, big endian if I remember correcty.)

My bigest gripe with the code was that it triggered an endless stream of overflow errors in the minor error log. This would happen when copying numbers larger than 128 into bytes. ControlLogix would upgrade them from signed bytes into integers and then complain that it couldn't fit all the extended sign bits back into an unsigned byte. (Or something like that) I cleaned up a couple of them, but I think there were a few left when I ran out of time.

The total rung count was 145 spread over 14 routines. Here is a breakdown:
MainRoutine 10
ClearBuffer 1
CRCLoopR 2
CRCLoopT 2
CRC_TaskR 2
DataPack 4
Decode 46
H1Z_Modbus_Activate 16
IO_Scanner 21
ReadCoils_Inputs 10
ReadReg_Inputs 9
ReceiveMonitor 22
ShiftbitLeft 2
ShiftbitRight 2
WriteCoils 6

(I just looked at MainRoutine, and 8 of those rungs were my housekeeping rungs, unrelated to the Modbus functions. :) )

It's a good thing he broke it down into so many routines because the routine names and the UDT structure member names are about the only documentation in the code.

Now he does use some of the very advanced ControlLogix concepts -- you know, things like array indexing :) -- so that increases the difficulty of converting it to S7 LAD or FBD. While most accesses seem, surprisingly, to be to fixed indexes, there are still a good number of variable indexes. ControlLogix is also more intelligent about converting types, so you would have to add in a few more instructions for this.

Those with access to RSLogix5000 and a need to handle Modbus should check it out. It looks fairly straightforward: build up the command block, send it out, wait for the response.

And for those of who wanting to know what possible use the Masked Move (MVM) has, I see that he has a couple of those in there to handle the ReadCoils command. :)
 
Last edited:
Or, if you happen to use the ET200S distributed i/o on Profibus, then there is a dedicated module to put in an ET200S rack.
As far as I have heard the max baudrate with this module is 19200.
It is much less expensive than the CP341 solution though.
Here is the manual for the ET200S 1SI solution:
http://support.automation.siemens.c...view/en/9260793

I am using this module successfully, the FB is easy to implement but configuring the conversion data block takes a bit of time to sort out but once it is working it is fine.

I have a dedicated set of markers and a data block for the data transfer.

Not all my own work as Siemens initiialy set it up for me.
 

Similar Topics

Hi guys, Could i connect simatic WinCC runtime with Micrologix 1400 PLC via Modbus?
Replies
0
Views
1,243
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
81
Dear sir, I am using SIMATIC 300, CPU 315-2DP , (6ES7 315-2AF03-0AB0) VIPA 603-1CC21 A1.0 RAM 32KB, Firmware=V4.0.8 The problem Im using MPI...
Replies
2
Views
164
Hi, I received this SIMATIC S7-300 training kit for maintenance. When I power it up, the PLC doesn't go to RUN mode and the STOP mode led is...
Replies
7
Views
300
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
316
Back
Top Bottom