In this article, we will set up PROFISAFE communication between S71200-G2 and S71516F-3. To establish this configuration, it is necessary to use the I-Device function, where the S71516F-3 acts as the device and the S71200-G2 acts as the controller.
Now, let’s enjoy FA!

Reference Link
http://soup01.com/ja/category/siemens-jp/s7%e2%80%901200-g2/
PROFINET I-Device Function?
With the I-Device function, various tasks can be achieved. These include:
- Efficient engineering that also supports fail-safe applications
- Sustained reduction of engineering costs and commissioning time
- Reduction of required network and system components
- Simplification of communication within machinery and plants
- Simple communication between heterogeneous systems
An I-Device is a CPU/CP used as an intelligent IO device. Through this function, PROFINET enables communication not only with lower-level devices, but also allows IO communication as an IO device with other higher-level or central controllers.

Example of Using I-Device
An example of using an I-Device is when you have a main IO controller/data concentrator and other “sub-level” controllers that require the same information from the concentrator.
Suppose you run a juice factory here. In this factory, each machine needs to know the type of juice. For example, the box type for the packaging machine or the label type for the labeling machine. Sub-level controllers play the role of IO device peers, and the master controller sends the juice type to all sub-level controllers. The sub-level controllers then convey the current juice recipe to their respective local IO devices.
Another reason to use an I-Device is to communicate between different controllers without writing a lot of communication code. I-Device provides the ability to configure a high-speed (update time 1 ms or less) PROFINET Real-Time connection (RT/IRT) between two or more controllers from different manufacturers. Implementation is easy, as the I-Device is configured like a normal IO device on the controller.
All that is required for programming is handling the IO logic. First, set up the I-Device by creating the I-Device controller configuration and the maximum IO buffer size.
After that, export the GSD file of the I-Device and set it up by importing it into the controller configuration tool. Afterward, each controller has input and output buffers to exchange data with application partners.

Difference from Standard Communication
In this article, PROFISAFE communication via I-Devices is conducted between S71200-G2 and S71516. Safety-related communication between the IO controller and I-Device failsafely transfers a fixed amount of data between safety programs in the F-CPU.
In contrast to standard communication, the inputs and outputs of the created transfer area of the IO controller or I-device are not accessed directly.
Data is transferred using the “SENDDP” instruction and received using the “RCVDP” instruction, stored in the configured transfer area of the device. The transfer area consists of input address ranges and output address ranges. “SENDDP” provides the respective outputs of the IO controller/I-device, and “RCVDP” reads their inputs.

Data Transfer
Even in a safety environment, transfer areas are required for communication between the IO controller and IO devices. This is where transferred data is stored. These transfer areas are assigned to the “SENDDP” and “RCVDP” blocks, which are used for data exchange in safety-related environments.
Rules
There are the following rules for PROFISAFE communication via I-Devices.
- In SIMATIC S7-300/400 controllers, the transfer area for sending data must have the same start address for output data and input data.
- 12 bytes (fixed) are required for the output data transfer area, and 6 bytes (fixed) are required for the input data transfer area.
Usage Example
The figure below shows a simple example.
-
“SENDDP” sends 12 bytes to the partner.
These 12 bytes consist of 6 bytes of F IO data (16 Boolean values and 2 INT values) and 6 bytes of F parameters. - “RCVDP” responds to this data with an acknowledgment of 6 bytes of F parameters.

Data Transfer Limits
If the amount of data to be transferred exceeds the capacity of a single linked “SENDDP”/”RCVDP” instruction set, there is no choice but to use additional “SENDDP”/”RCVDP” instructions.
To do this, let’s increase the Transfer Area. The table below shows how many output and input data bytes are assigned in safety-related communication connections.
SENDDP and RCVDP Basics
Safety-related communication between an IO controller and an I-device is performed using the “SENDDP” instruction for sending data and the “RCVDP” instruction for receiving data. These instructions allow fail-safe transfer of 16 BOOL values and 2 INT values (or 1 DINT value in S7-1200/1500).
- The RCVDP instruction must be called at the beginning of the main safety block.
- The SENDDP instruction must be called at the end.
Send and receive data failsafely using SENDDP and RCVDP instructions:
- Safety-related master-master communication
- Safety-related master-master communication regarding S7 Distributed Safety
- Safety-related master-slave communication
- Safety-related I-slave – I-slave communication
- Safety-related IO controller – IO controller communication
- Safety-related IO controller – IO controller communication for S7 Distributed Safety
- Safety-related IO controller – I-device communication
- Safety-related IO controller – I-slave communication
Notes
- During safety program acceptance, uniqueness must be checked in the safety summary. When calling this instruction, constant values must be specified for the DP_DP_ID and LADDR inputs.
- In safety programs, direct write access to DP_DP_ID and LADDR of the relevant instance DB is not permitted.
- In PROFIBUS, the network includes all nodes accessible via PROFIBUS DP.
- In PROFINET IO, all nodes accessible via RT_Class_1/2/3 (Ethernet/WLAN/Bluetooth, Layer 2) and RT_Class_UDP (IP, Layer 3) are included in the network.
- S7-1200/1500: In version V3.0 of SENDDP and RCVDP instructions, a connection is not established if the DP_DP_ID input is set to F-communication ID “0”.
- S7-1200/1500: From version V3.0 onwards of SENDDP and RCVDP instructions, variable values from a global F-DB can also be specified for the DP_DP_ID input.
- In redundant S7-1500HF systems, regarding DP_DP_ID, both F-CPUs of the redundant S7-1500HF system are treated as a single F-CPU.
SENDDP
The “SENDDP” instruction fail-safely transmits 16 BOOL data items and 2 INT data items from one F-CPU to another F-CPU via PROFIBUS DP/PROFINET.

VAR_INPUT
Parameter Name | Data Type | Description |
|---|---|---|
SD_BO_00 to SD_BO_15 | BOOL | Data send BOOL 00-15 |
SD_I_00 | INT | Data send INT 00 |
SD_I_01 | INT | Data send INT 01 |
DP_DP_ID | INT | Communication ID between SENDDP and RCVDP |
TIMEOUT | TIME | Monitoring time for safety-related communication (unit: ms) |
LADDR | HW_SUBMODULE | HW identifier of address area/transfer area |
VAR_OUTPUT
Parameter Name | Data Type | Description |
|---|---|---|
ERROR | BOOL | 1=Communication error |
SUBS_ON | BOOL | 1=RCVDP outputs fail-safe values |
RET_DPRD | WORD | Non-fail-safe error code RET_VAL of DPRD_DAT instruction |
RET_DPWR | WORD | Non-fail-safe error code RET_VAL of DPWR_DAT instruction |
DIAG | BYTE | Non-secure service information |
RCVDP
You can receive data from this RCVDP instruction.

VAR_INPUT
Parameter Name | Data Type | Description |
|---|---|---|
ACK_REI | BOOL | 1=Reset after communication error |
SUBBO_00 to SUBBO_15 | BOOL | Fail-safe value for received data BOOL 00 |
SD_I_01 | INT | Data send INT 01 |
DP_DP_ID | INT | Communication ID between SENDDP and RCVDP |
TIMEOUT | TIME | Monitoring time for safety-related communication (unit: ms) |
LADDR | HW_SUBMODULE | HW identifier of address area/transfer area |
SUBI_00 | INT | Fail-safe value for received data INT 00 |
SUBI_01 | INT | Fail-safe value for received data INT 01 |
DP_DP_ID | INT | Communication ID between SENDDP and RCVDP |
TIMEOUT | TIME | Monitoring time for safety-related communication (unit: ms) |
VAR_OUTPUT
Parameter Name | Data Type | Description |
|---|---|---|
ERROR | BOOL | 1=Communication error |
SUBS_ON | BOOL | 1=RCVDP outputs fail-safe values |
ACK_REQ | BOOL | 1=Acknowledgment required for reintegration of sent data |
SENDMODE | BOOL | 1=F-CPU in safety mode with invalid SENDDP instruction |
RD_BO_00 to RD_BO_15 | BOOL | Receive data BOOL 00 to 15 |
RD_I_00 | INT | Receive data INT 00 |
RD_I_01 | INT | Receive data INT 01 |
RET_DPRD | WORD | Non-fail-safe error code RET_VAL of DPRD_DAT instruction |
RET_DPWR | WORD | Non-fail-safe error code RET_VAL of DPWR_DAT instruction |
DIAG | BYTE | Non-secure service information |
Timing Chart
This is the timing chart for SEND_DP and RCVDP_DP.

DP_DP_ID Parameter for Multiple I-Devices
The “DP_DP_ID” parameter of the “SENDDP” and “RCVDP” instructions is a unique ID within the network for “SENDDP” and “RCVDP” instructions communicating with each other. When using multiple “SENDDP”/”RCVDP” instructions, the “DP_DP_ID” input must be adjusted accordingly.
The figure below shows a configuration example of the instructions.

Implementation
This time, configuration is required on both S71516F-3 and S71200-G2.
Create 2 New Devices
First, create a TIA project and add two CPUs into it. In this example, they will be S71516F-3 and S71214FC.

Configure IP address
Next, switch to Network View and configure the IP address for each CPU.

Click the button shown in the figure below.

Adjust the IP addresses of the devices to match your application.

S71500 Side
First, configure the S71516F-3 side.

Configure I-Devices
In this article, the S71516F-3 side is the F-Device, so please double-click the S71516F-3.

Operation Mode
Check the “IO device” checkbox under PROFINET Interface > Operation Mode.

Now you will be able to set the Assigned IO Controller drop-down list.

Since we are connecting the S71516F-3 with the S71200-G2 in this article, let’s set the PROFINET interface for the S71200-G2.

Done!

The PROFINET network between S71516F-3 and S71200-G2 has been created.

Transfer area
Next, click Operation Mode > I-device communication and set up the communication area between S71516F-3 and S71200-G2.

Click Add new to create a new transfer area.

Done!

Since this article focuses on PROFISAFE communication, set the Type to F-CD.

Done! New PROFISAFE communication has been added (S71200-G2 IO Controller → S71516F-3 IO Device).

Add communication in the same way for S71516F-3 IO Device → S71200-G2 IO Controller as well.

dbDataToS71200G2
Add a DB to the S71516F-3 project and define the parameters to assign to the SENDDP FB.

dbDataFromS71200G2
Next, add another DB and define the parameters to assign to RCVDP.

Safety Program
Create the Safety program.

Network2
Network 2 calls RCVDP and defines the required parameters.

DP_DP_ID=1
Set the ID of RCVDP on the S71516F-3 to 1.

TIMEOUT
Set the Timeout monitoring time for RCVDP.

LADDR
LADDR in RCVDP for S71516F-3 is the name defined in the Transfer Area. Since this is the FB received by S71516F-3, please set the HW name carefully.


Network3
Network 3 calls SENDDP and defines the required parameters.

DP_DP_ID=2
Set the ID of SENDDP on the S71516F-3 to 2.

TIMEOUT
Set the Timeout monitoring time for SENDDP.

LADDR
LADDR in SENDDP for S71516F-3 is the name defined in the Transfer Area. Since this is the FB transmitted by S71516F-3, please set the HW name carefully.


Download
Finally, download the project to the S71516F-3.
S71200 Side
Next, set up the S71200-G2 side.

dbDataToS71500
Add a DB to the S71200-G2 project and define the parameters to assign to the SENDDP FB.

dbDataFromS71500
Next, add another DB and define the parameters to assign to RCVDP.

Safety Program
Create the Safety program.

Network2
Network 2 calls RCVDP and defines the required parameters.

DP_DP_ID=2
Set the ID of RCVDP on the S71200-G2 to 2.

TIMEOUT
Set the Timeout monitoring time for RCVDP.

LADDR
LADDR in RCVDP for S71200-G2 is the name defined in the Transfer Area. Since this is the FB received by S71200-G2, please set the HW name carefully. It is also possible to set an integer directly.

Network3
Network 3 calls SENDDP and defines the required parameters.

DP_DP_ID=1
Set the ID of SENDDP on the S71200-G2 to 1.

TIMEOUT
Set the Timeout monitoring time for SENDDP.

LADDR
LADDR in SENDDP for S71200-G2 is the name defined in the Transfer Area. Since this is the FB transmitting data from S71200-G2, please set the HW name carefully. It is also possible to set an integer directly.

Download
Finally, download the project to the S71516F-3.
Summary of DP_DP_ID
Here is the list of DP_DP_ID settings between the two CPUs.

Results
Done! I-Device communication between S71200-G2 and S71516F-3 has been established.

The PROFISAFE data transferred by the S71200-G2 transmitter was successfully received on the S71516F-3 side.

In addition to BOOL variables, integer data could also be sent.

And there are no errors or diagnostic warnings in the FB.

Also, PROFISAFE data transferred from the opposite direction by the S71516F-3 was successfully received on the S71200-G2 side as well.

And in addition to BOOL variables, integer data could also be sent.

Next, disconnect communication between S71200-G2 and S71516F-3.

Change Safety Fail parameters 00, 01, and 02 to TRUE.

SUBS_ON becomes TRUE, indicating that the FB is currently using Fail Safe data.

Finally, restore PROFINET communication between S71200-G2 and S71516F-3.

However, ACK_REQ becomes TRUE, meaning the FB is currently waiting for a reset request.
Unless the FB receives a reset request, the output will remain Fail Safe output.

Finally, let’s send a reset request to the FB.

Done! The output of the FB has returned to normal.
