Siemens S7-300 PLC as a Modbus TCP Slave or Master

D

Thread Starter

David Wisti

Can a Siemens S7-300 CPU315-2 DP with a CP343-1 Ethernet card communicate as a Modbus TCP slave or master? If so, is there any example code someone is willing to share?
 
Hi, I told you that siemens do not offer ModBus Communications but I found ET200S-modbus_SIprod_info_76.pdf file where is described a possibility using ET 200S Serial Interface Modbus/USS Module,

Best
 
If I am not wrong Siemens do no offer ModBus communications, anyway with a Siemens S7-300 CPU315-2 DP with a CP343-1 you could get communications using Profibus DP (may be you can also use Profibus FMS)

I hope this helps you, you can send me a mail to autcon20ATyahooDOTcomDOTar
 
You require a Point-to-Point Communications Module CP341 installed in the rack along with the Modbus Dongle to activate the Modbus Drivers. I have documentation if you need further info.

Regards - Richard
 
D
Richard,

Thanks for the info, I didn't know about the CP341 and Modbus. Actually, I'm looking for a Ethernet solution using function codes FC60 AG_LRECV and FC50 AG_LSEND with an Ethernet CP. The CP341 is a serial port (RS232/422/485) and that solution is Modbus RTU not TCP. Siemens does have an Open Modbus library but I can't seem to find any information other than a part number:

FB OPEN MODBUS / TCP
2XV9450-1MB00-0YE0

David
 
D

Daniel Chartier

Hello David;

I always presumed (not to say "assumed") that Siemens did not support Modbus/TCP. Your post made me look a little deeper, and here is what I found on different Siemens webpages:

Siemens websites on Modbus/TCP options:

Flyer:
http://cache.automation.siemens.com/dnl/TU1MDU3NQAA_22660304_FAQ/Modbus_TCP_Flyer_English.pdf

Manual:
http://cache.automation.siemens.com/dnl/jQwOTU3AAAA_22660304_FAQ/Open_Modbus_TCP_HB_English.pdf

You can obtain further information on this topic at the following address:
Siemens AG
Industrial Solutions & Services
Information Technology Plant Solutions
Werner-von-Siemens-Str. 60
D-91052 Erlangen
Tel.: +49 91 31 7-46111
Fax +49 91 31 7-44757
E-mail: [email protected]
Internet: <http://www.industry.siemens.com/IT4Industry/EN/INDEX.HTM>

If you are located in Amwerica, note that you might have trouble getting pricing and delivery info from your local rep; divisdion of certain Siemens markets and products may be strange to understand for us laymen. In that case you would need to deal directly with the European providers, possibly using a Simatic Card (prepaid buying cards used for certain transactions over the web).

Thanks for the new comm. oppertunities,
Daniel Chartier
 
S

Shahid Waqas

I do not think that Siemens does Modbus TCP, as far as I know. (Dont know of any latest developments - Siemens people: Any comment)

However, they do the Serial Modbus. You need CP341 (Serial) and Modbus software for either Master or Slave (as required). I have seen simplex connection, but not sure if it would do redundant modbus communication as well!
--
Best Regards,
*Shahid Waqas*
[email protected]
 
J

John Barnet Engineering

The S7 300 will do Modbus TCP if you have the newest Ethernet card. It is very easy and the part number you listed is correct. When you purchase the package there are samples contained within the software.

You can also go to http://support.automation.siemens.com and search their FAQs for Modbus TCP and it will tell you everything you need to know and it has a manual you can download to tell you all the details.

Your Siemens rep can also get you more information or you can call their hotline and ask them.
 
D
Daniel,

Thanks for tracking that info down, it should help it trying to purchase this library. My Siemens Rep. said, "Since it's very pricey for one thing but also it's not readily available/supported here in the US." He went on to say there might be shareware versions meaning customers had made there own custom implementation of Modbus TCP. Its very feasible to write a custom protocol with FB50 and FB60. I was hoping someone else has been down this path and might have a working example to share. I really only need to implement a simple class 0 master or slave.

David
 
M

Michael Griffin

If anyone some reason decides to write their own Modbus TCP implementation for the S7-300, Siemens wrote a Modbus RTU (not TCP) "driver" for the S7-200 in ladder (or possibly IL, I haven't looked at it) which they provide for free. This could be used as an implementation guide for the S7-300.
 
Try to use CP315-2DP with a CP343-1 and the FB OPEN MODBUS / TCP driver ver 2.1 (2XV9 450-1MB00).
 
Y

Yesid Hernandez

Hi,

I have a similar app, but with a S7-224 CPU and the CP231-1 Ethernet Interface, I will like to know if anyone have any idea to get the Modbus/TCP slave configuration working with this equipment. Thanks.
 
The Open Modbus/TCP you describe has a few problems. It uses the AG_SEND and AG_RECV Siemens blocks, which in turn use SFC58 and SFC59.

In any complete TCP/IP transaction, these limit the length of any transfered data to 240 bytes. (Some of the CPs are stated to transfer more, but they do this by splitting the data into 240 byte transactions).

Unfortunately Siemens do not seem to have implemented the IP protocol fragmentation scheme correctly, so each of these transactions will appear (to, for example, a Windows socket) as complete and separate.

The maximum data length of a Modbus RTU message is 255 bytes, and the Modbus TCP header adds a further 6 - i.e. greater than the 240 limit.

If you are sure that you will never have more than 240 characters (which is 234 if you exclude the ModbusTCP header) then you are probably OK. If you are not certain, then you should take further advice.

dr
 
I went to the webpage and tried to find the S7 example mTCPRead project. I can't seem to find it. Can you provide a link?
 
M

Mohoch Megabar

Hello Richard,

I came across your message and thank god. I have a serious application where I need an existing S7-300 with a CPU 314 2DP to communicate with a set of 8 Schneider SEPAM Power relay set as Modbuse slaves 2 through 9. Could you kindly forward your documentation to my e-mail address at satel_ service @ yahoo. com, since my connection to the internet is so slow that I cannot download any reasonable size file?

Thank you in advance for all your kindness and best regards.

Mohoch Megabar
 
Top