Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 99741686, Entry date: 01/07/2015

Sample program MODBUS Slave (standard block) zXX21_05_PtP_Com_MODSL.zip for STEP 7 (TIA Portal)

  • Entry
  • Associated product(s)

This sample program, contained in the project zXX21_05_PtP_Com_MODSL, includes the standard functions for operating the communications processors CP 341 and CP 441-2 (as MODBUS Slave).

Software requirements
The .zip file includes two projects:
STEP 7 Professional V11.0 + SP 2
STEP 7 Professional V13

Structure of the sample program
In this example, a communication connection is enabled between a MOSBUS Master control system and the communications module CP 341 (S7-300) or CP 441-2 (S7-400). The function codes below can be used for the communication between CP and the third-party system:

  • 01 (Read Coils)
  • 02 (Read Discrete Inputs)
  • 03 (Read Holding Registers)
  • 04 (Read Input Register)
  • 05 (Write Single Coil)
  • 06 (Write Single Register)
  • 08 (Diagnostic)
  • 15 (Write Multiple Coils)
  • 16 (Write Multiple Registers)

Installation of the sample program
After downloading the project you must unpack the ZIP archive; a local path in the Engineering Station must be used as target path for the project. After unpacking, start the TIA Portal and open the project in the Portal View. The examples described are now available in the Project View.


Last change
Update to STEP 7 V13.

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.