In the user program of an S7-300 or S7-400 CPU with integrated PN interface, how can you read out the current topology of the PROFINET IO system connected?
In this entry, we show you how to read out the current topology of the PROFINET IO system connected in the user program of an S7-300 or S7-400 CPU with integrated PN interface.
This is needed in plants where tools are used at different points in the plant, for example, and the interconnection of the PROFINET IO nodes thus changes.
You can read out the neighbor information of ports with SFB52 "RDREC" using data record number 802A (hex). In this way, you determine the topology data of the PROFINET IO nodes. You can evaluate and process this data in the user program.
A description and sample program for parameterizing the SFB52 "RDREC" are available below for downloading.
38566021_NET_topology_SFB52_e.pdf ( 471 KB )
The sample program is a STEP 7 project that contains the complete hardware configuration including the user program of an S7-300 station. The STEP 7 project is available for downloading as a ZIP file.
Extract the "PNIO_SFB52.zip" file into a separate directory. The STEP 7 project is unpacked automatically with all its subdirectories. You can then use the SIMATIC Manager to open and process the extracted STEP 7 project.
PNIO_SFB52.zip ( 512 KB )
LLDP, Link Layer Discovery Protocol