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 serverUse 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.
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040