Technical Forum

SIMATIC S7-1200

Tips and sample program for MODBUS TCP

Thread Starter: Pegaia   Started: 8/10/2011 3:05 PM   Replies: 32

« Previous thread Next thread »
1234» Page 1 of 4 (33 items)
  8/10/2011, 3:05 PM
Joined 7/24/2008
Last visit: 7/25/2014
Posts: 2468
Rating:
Rated: Excellent [4.33 out of 5 / rated 432 time(s)]. (432) 
Users with special expertise supervising conferences
Rated: Excellent [5 out of 5 / rated 2 time(s)]. (2) 

Hi,


Here there are a sample project and some tips for implementation of MODBUS TCP with S7-1200:

1 - Pre requisites: STEP 7 >= V11 SP1 and S7-1200 FW >=2.1

2 – Documentation: the help on line of the blocks MB_SERVER and MB_CLIENT are the best way to get information about these blocks.

3 – Programming:

3.1 – On MODBUS TCP server

Use MB_SERVER instruction on the server:

Ports: as default you can use 502, however it is possible to use any ELSE ports already
used by S7-1200 (20, 21, 25, 80, 102, 123, 5001, 34962, 34963 and 34964).

Each connection needs a block call (with different instance DB, ID and port)


3.2 – On MODBUS TCP client:

Use MB_CLIENT instruction on the client:


Each connection need a block call (with different instance DB). ID and port must match with the server).

4 - Status 7002 = meaning that there is no client connected.

Attachment: MODBUSTCP.zip  (3981 Downloads)

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com

Top
Thank you for this post from:
  8/10/2011, 4:09 PM
Joined 7/7/2010
Last visit: 7/27/2014
Posts: 2965
Rating:
Rated: Excellent [4.01 out of 5 / rated 335 time(s)]. (335) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Thank you for the example program.

It helped me get the proper DB P# syntax for the holding registers in the S7-1200 PLC running FW 2.1.2 (which is running in compatability mode...?).

I find out the command I used with the MB TCP Server in TIA Portal 10.5 SP2 isn't supported.

PC MB/TCP Reads 100 registers, and MB/TCP Writes to a different 100 Registers on the S7-1200 PLC.  This basically creates a huge data highway for bits, bytes, and UINTs to send/receive commands and signals.

This works great in 10.5 SP2's MB TCP server.

Please put that back!  I cannot use the server without those functions.

Until then, I'm stuck in the 10.5 SP2 world.

:(



=== Edited by huggy_d1 @ 8/10/2011 4:09 PM [GMT ] ===
edited typo


Helpful? Rate it.
Solved? Post it.
Top
  11/3/2011, 8:32 PM
Joined 10/9/2011
Last visit: 1/27/2014
Posts: 20
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Helo Pegaia!
Do You have same tips for MODBUS RTU TIA v11 upd2 ?



=== Edited by polonez @ 11/3/2011 8:33 PM [GMT ] ===


=== Edited by polonez @ 11/3/2011 8:32 PM [GMT ] ===


Top
  11/4/2011, 12:02 PM
Joined 7/24/2008
Last visit: 7/25/2014
Posts: 2468
Rating:
Rated: Excellent [4.33 out of 5 / rated 432 time(s)]. (432) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

you don't should have problem to open in V11 SP1 upd2. Did you have any problem to open it?

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com
Top
  11/4/2011, 5:25 PM
Joined 10/9/2011
Last visit: 1/27/2014
Posts: 20
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
This is example MODBUS TCP I'm looking for MODBUS RTU.

Look here:
https://www.automation.siemens.com/BR/forum/guests/PostShow.aspx?PageIndex=1&PostID=320106&Language=en#320106



=== Edited by polonez @ 11/4/2011 5:28 PM [GMT ] ===


Top
  11/8/2011, 9:46 PM
Joined 11/7/2011
Last visit: 7/24/2014
Posts: 3
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi I have a problem with using the projekt. Im able to open the projekt, but then it says that i need STEP7 Basic V11.0 SP1..
But i have already STEP7 Professionel V11.0 SP1

Isnt the professionel supposed to open smaller versions like STEP7 Basic ???

Best regards Jacob, Denmark laugh
Top
  11/9/2011, 10:34 AM
Joined 7/24/2008
Last visit: 7/25/2014
Posts: 2468
Rating:
Rated: Excellent [4.33 out of 5 / rated 432 time(s)]. (432) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,
you don't should to have problems to open it.
Did you have alread tried to install upd2 for V11 SP1?

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com
Top
  11/9/2011, 10:46 AM
Joined 11/7/2011
Last visit: 7/24/2014
Posts: 3
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi

I have installed the upd 2 for V11.
The error message i get is in the picture attached

Attachment: 1.jpg  (462 Downloads)

Top
  11/9/2011, 2:09 PM
Joined 7/24/2008
Last visit: 7/25/2014
Posts: 2468
Rating:
Rated: Excellent [4.33 out of 5 / rated 432 time(s)]. (432) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,
please instal de SP1:
http://support.automation.siemens.com/BR/view/en/51696778

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com
Top
Thank you for this post from:
  11/9/2011, 2:54 PM
Joined 11/7/2011
Last visit: 7/24/2014
Posts: 3
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

Works much better now togue

Thank you for the help
Regards Jacob
Top
1234» Page 1 of 4 (33 items)
Actions