How do you read consistent data from a DP standard slave/PROFINET IO device and write it consistently to a DP standard slave/PROFINET IO device?
SFC 14 "DPRD_DAT"
Using the system function SFC 14 "DPRD_DAT" (read consistent data of a DP standard slave) you read out the data of a DP standard slave/PROFINET IO device. If no errors occurred during the data transfer, the data read is entered into the target area set up by RECORD. The target area must have the same length as you configured with STEP 7 for the selected module. With a DP standard slave with modular structure and with multiple DP identifications, with an SFC 14 call you can only ever access the data of one module / DP identification under the configured start address.
SFC 15 "DPWR_DAT"
Using the system function SFC 15 "DPWR_DAT" (write consistent data to a DP standard slave) you transfer the data in RECORD consistently to the addressed DP standard slave/PROFINET IO device. The source area must have the same length as you configured with STEP 7 for the selected module.
With a DP standard slave with modular structure you can only access one module of the DP slave.
Maximum length and addressing of consistent user data areas on the PROFIBUS DP
In the manuals listed below you will find more information about the maximum length and addressing of consistent user data areas on the PROFIBUS DP.
|Addressing||SIMATIC ET 200pro IM 154-8 PN/DP CPU interface module|
Maximum length and addressing of consistent user data areas on the PROFIBUS IO
In the manuals listed below you will find more information about the maximum length and addressing of consistent user data areas on the PROFIBUS.
|Consistent Data||SIMATIC S7-400 S7-400 Automation System, CPU Specifications|
For communication processors (CPs) the size of the consistent area for a submodule is defined as follows.
|CP||Article number||Upper limit|
|CP 443-1||6GK7443-1EX20-0XE0||240 bytes|
|CP 443-1||6GK7443-1EX30-0XE0||240 bytes|
|CP 443-1 Advanced||6GK7443-1EX40-0XE0||128 bytes|
|CP 443-1 Advanced||6GK7443-1EX41-0XE0||240 bytes|
|CP 443-1 Advanced||6GK7443-1GX20-0XE0||240 bytes|
|CP 443-1 Advanced||6GK7443-1GX30-0XE0||240 bytes|
|CP 343-1||6GK7343-1EX21-0XE0||128 bytes|
|CP 343-1||6GK7343-1EX30-0XE0||240 bytes|
|CP 343-1 Advanced||6GK7343-1GX21-0XE0||128 bytes|
|CP 343-1 Advanced||6GK7343-1GX30-0XE0||240 bytes|
|CP 343-1 Advanced||6GK7343-1GX31-0XE0||240 bytes|
The PROFIBUS DP standard defines upper limits for the transfer of consistent user data. Current DP standard slaves keep to these upper limits. Older CPUs (<1999) have CPU-specific restrictions for the transfer of consistent user data.
The maximum length of data that these CPUs can read consistently from a DP standard slave or write consistently to a DP standard slave is given in the technical data under "DP master – user data per DP slave". With this value, more recent CPUs exceed the length of the data that a DP standard slave provides or receives.
Distributed reading and writing of consistent data (<4 bytes) is also possible without system functions SFC 14 and SFC 15. Which modules you can use for this is described in Entry ID 8751062.
The table below shows the access to consistent data outside the process image.
|Length of data area||Read/write access||Data consistency|
|1 byte||Load / Transfer||Consistency over unit|
|2 bytes||Word Load / Word Transfer||Consistency over total length|
|3 bytes||SFC 14 / SFC 15||Consistency over total length|
|4 bytes||Double-word Load / Double-word Transfer||Consistency over total length|
|5 bytes or more||SFC 14 / SFC 15||Consistency over total length|
In the example below an S7-400 CPU is used as DP master and a CP342-5 as DP slave.
The consistency area below is defined for the inputs and outputs of the DP slave:
- For the outputs, 50 bytes are transferred consistently over the total length. These 50 bytes are available consistently in the process image partition 3 (PIP 3) of the S7-400 CPU and can therefore be read using load/transfer commands.
- For the inputs, 20 bytes are transferred consistently over the total length. These 20 bytes are not stored in the process image or in process image partition and can only be written with the system function SFC 14/15.
The operating system of the CPU transfers the data consistently during process image updating. You can access this data in the process image using the load and transfer commands.
Alternatively, with S7-400 CPUs you can use system function SFC 26 "UPDAT_PI" or SFC 27 "UPDAT_PO" at any point in the program to update the process images. However, in this case the relevant PIP may not be updated by the system. If you do not or cannot place the data in a process image, then you should use the system functions SFC 14 and SFC 15 for data communications.
More information on this is available in the following entries:
- "Consistent data in S7-400, summary of mechanisms" - Entry ID: 11646774
- "Use of Process Image Partitions in Organization Blocks" - Entry ID:18325216