Overview
The LPNDR (Library for PROFINET Data Records) block library is a Siemens-supplied collection of SCL/FB function blocks for the SIMATIC S7-1200/S7-1500 controllers that read PROFINET diagnostics and configuration data records directly from PN devices. The library is published by Siemens as support entry 109753067 and is the recommended user-program method for reading record sets such as GlobalInfo, PortStatistics, NeighborInfo, and LLDP-MIB from PROFINET switches (e.g. SCALANCE XC208, XC216, XR-500) and I/O stations that are already accessible from the controller's PROFINET interface.
For TIA Portal users who need to identify what is plugged into a SCALANCE XC208 — port status, station names, MAC addresses — the LPNDR library is the right starting point. It does not, however, expose the IP addresses of the connected nodes. That limitation is critical for any commissioning engineer who plans to use LPNDR as a topology-discovery tool alongside or as a substitute for SINEC PNI.
Where to Obtain the LPNDR Library
- Open the Siemens Industry Online Support entry 109753067 – Library for PROFINET data records.
- Download the ZIP archive that contains the global library (
.zal16/.al16) and the example project. - Extract to a working directory. Do not open the library directly from the ZIP — TIA Portal cannot edit or read libraries in compressed form.
- In TIA Portal, choose Options → Global libraries → Open library and browse to the extracted
.al16file. - Drag the
LPNDRmaster copies from the library's Types folder into your project's Program blocks.
Function Block Inventory
The library exposes a family of FBs whose names follow the pattern LPNDR_<RecordName>. Each block wraps a single PROFINET Read Record (RPC Read Record) service call against the configured device.
| Function Block | Data Record (Index) | Return Data | Typical Use |
|---|---|---|---|
LPNDR_ReadGlobalInfo |
0x0001 (PDIRData / GlobalInfo) | Vendor ID, Device ID, Station name, MAC address, Port list, Port-to-station mapping | Identify what is connected to a SCALANCE switch and on which port |
LPNDR_ReadPortStatistics |
0x0002 (PDIRData / PortStatistics) | Per-port counters: discarded, lost, CRC errors, frames sent/recv | Detect cable faults or port flap on the XC208 |
LPNDR_ReadNeighborInfo |
0x0003 (PDIRData / LLDP neighbor) | LLDP neighbor chassis ID, port ID, TTL, system name | Build a Layer-2 topology map from a controller's perspective |
LPNDR_ReadPortMirrorInfo |
0x000F | Mirror port, mirrored source ports, direction | Verify a configured SPAN/TAP on SCALANCE X switches |
LPNDR_ReadLLDP-MIB |
0x0004 | LLDP statistics, peer table | Complement to ReadNeighborInfo |
Each block contains the same call pattern: it issues a RDREC (read data record) instruction to the configured PROFINET device on the configured AR (application relationship) and unpacks the returned raw byte stream into a typed UDT instance for direct access in the user program.
LPNDR_ReadGlobalInfo Interface
The most commonly requested block — and the one referenced in the field report — is LPNDR_ReadGlobalInfo. Its standard instance DB exposes the following inputs and outputs (confirm with the version of the library downloaded for your TIA Portal release):
| Element | Direction | Type | Meaning |
|---|---|---|---|
REQ |
IN | BOOL | Rising edge starts the asynchronous read |
LADDR |
IN | HW_DEVICE (WORD) | Hardware identifier of the target PROFINET device (SCALANCE XC208) from the device configuration |
RECORD_INDEX |
IN | BYTE | Defaults to 0x0001 (GlobalInfo); change to 0x0002/0x0003 for other records |
BUSY |
OUT | BOOL | TRUE while the read is in progress |
DONE |
OUT | BOOL | TRUE on successful read (one PLC cycle) |
ERROR |
OUT | BOOL | TRUE if the record read returned a PROFINET error |
STATUS |
OUT | DWORD | Hex status word; see STATUS decoding below |
GlobalInfo |
OUT | UDT | Parsed record payload (UDT instance defined inside the FB) |
The GlobalInfo UDT contains arrays for vendor/device ID, station names (as WSTRING), MAC addresses (as ARRAY[1..6] OF BYTE), and port descriptors. The exact element count depends on the connected switch's port density — for a SCALANCE XC208 the array is sized for up to 8 ports.
STATUS Word Decoding
When ERROR is asserted, decode STATUS as follows (PROFINET Read Record negative response per the standard):
| STATUS (hex) | Meaning | Field Action |
|---|---|---|
| 0x0000_0000 | Success | — |
| 0x0000_80xx | DS0x status returned by device (xx = device-specific code) | Check device diagnostic buffer; for SCALANCE this is usually a wrong RECORD_INDEX or unsupported record |
| 0x0000_81xx | PRIO_NAK / busy | Retry after a short delay |
| 0x0000_DE8x | Access denied / protected record | Record requires a higher privilege or the device is in a protected mode |
| 0x0C01_xxxx | PROFINET IO controller layer error | Check LADDR; the HW identifier of the target is missing or the device is not in the AR |
| 0x80B0_xxxx | Vendor-specific PROFINET error | See SCALANCE WBM diagnostic log |
IP Address Limitation
LPNDR_ReadGlobalInfo does not return the IP address of the devices connected to the SCALANCE XC208. It returns the station name (PROFINET NameOfStation), the MAC address, the port list, and the slot/port mapping — but not the IP configuration. The reason is that the PROFINET PDIRData / GlobalInfo record is built by the device during AR setup and is independent of the IP suite. PROFINET does not propagate IP addresses to its neighbors through the LLDP or PDIR data records used by LPNDR.This is a real limitation when the operator console needs to map "which IP is on which port" for quick fault classification. Two practical workarounds are documented in the field report:
- Use SINEC PNI (Primary Network Initialization) to recursively walk the network from the engineering PC. PNI queries each reachable device for its IP suite via SNMP/PN DCP and therefore can populate the IP address column. PNI is not executable from a SIMATIC PLC — it runs on a Windows host and is suitable for commissioning and diagnostics, not for continuous runtime use from the controller.
- If the IP mapping must be available to the PLC, derive it indirectly: maintain a project-side table that maps station name → IP (entered at commissioning) and look up the IP by joining against the
GlobalInfostation name array.
SCALANCE XC208 Integration
To use the LPNDR library with a SCALANCE XC208 the switch must be present in the same PROFINET IO system as the S7-1500/1200 CPU that hosts the FB. The setup steps are:
- In the TIA Portal device view, add the SCALANCE XC208 to the PROFINET subnet of the CPU. Assign a device name and check the IO controller assignment.
- Confirm the switch is online and reachable — the IO LED on the XC208 should be solid green and the controller should report "No fault" on the device.
- Drag
LPNDR_ReadGlobalInfointo the program and create an instance DB. - Wire
LADDRto the Hardware identifier of the XC208 (visible in Properties → System constants or in the device's IO tag view). - Call the FB in a cyclic OB, for example OB1 or OB35, and trigger
REQfrom a clock generator (1 s is typical for monitoring; use 5–10 s for log-only use cases).
Calling Pattern in SCL
// Trigger read every second
IF "clk_1Hz" THEN
"db_ReadGlobalInfo"(REQ := TRUE,
LADDR := "Local~PROFINET_interface_1".SCALANCE_XC208.HW_ID);
END_IF;
// Edge-detect completion
IF "db_ReadGlobalInfo".DONE THEN
// Copy out for logging / HMI
"tagStationName" := "db_ReadGlobalInfo".GlobalInfo.StationName[1];
"tagMacAddress" := "db_ReadGlobalInfo".GlobalInfo.MacAddress[1];
END_IF;
IF "db_ReadGlobalInfo".ERROR THEN
"tagLastStatus" := "db_ReadGlobalInfo".STATUS;
END_IF;
Avoid calling the FB faster than the controller can complete the record read. On an S7-1516 with a single XC208 the round-trip is typically 30–80 ms; on a CPU 1214C it can exceed 200 ms. The BUSY output protects against re-trigger, but ignoring it (cycling REQ every scan) will generate error 0x0000_81xx (busy) and is a common cause of "empty UDT" complaints.
Reading Multiple Records Sequentially
Real commissioning diagnostics usually need GlobalInfo and PortStatistics from the same switch. The recommended pattern is a state machine that calls each FB in turn, gated on DONE or ERROR of the previous:
CASE "diag_state" OF
0: // Idle — wait for request
IF "diag_trigger" THEN
"db_ReadGlobalInfo"(REQ := TRUE, LADDR := "XC208_HW_ID");
"diag_state" := 10;
END_IF;
10: // GlobalInfo done?
IF "db_ReadGlobalInfo".DONE THEN
"db_ReadPortStats"(REQ := TRUE, LADDR := "XC208_HW_ID");
"diag_state" := 20;
ELSIF "db_ReadGlobalInfo".ERROR THEN
"diag_state" := 50;
END_IF;
20: // PortStatistics done?
IF "db_ReadPortStats".DONE THEN
"diag_state" := 0;
ELSIF "db_ReadPortStats".ERROR THEN
"diag_state" := 50;
END_IF;
50: // Fault — log and return to idle
"diag_state" := 0;
END_CASE;
Verification Procedure
- Compile and download the project. Go online with the controller.
- Open the instance DB of
LPNDR_ReadGlobalInfoin the watch table. ForceREQonce. - Confirm
BUSYrises, thenDONEpulses andERRORstays FALSE. - Expand the
GlobalInfoUDT — for each occupied port,StationName[n],MacAddress[n], andPortNumber[n]must be non-zero. - Cross-check one row against the SCALANCE WBM (Information → Port Statistics and Layer 2 → LLDP). The MAC address must match exactly.
- Disconnect a device and re-trigger the read. The corresponding array entry should revert to zeros within one cycle.
Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
UDT remains all zero after REQ
|
LADDR not bound to the SCALANCE HW identifier |
Open device properties, copy the Hardware identifier into the FB input |
STATUS = 0x0000_DE8x
|
Record index 0x0001 disabled on switch (PROFINET settings → Access control) | Enable PDIR/PDIRGlobalData read access on the SCALANCE |
STATUS = 0x0C01_xxxx
|
SCALANCE not part of the controller's AR | Re-assign the IO controller and download the device configuration |
STATUS = 0x0000_81xx on every scan |
FB called faster than record completes | Gate REQ with a 1-second clock and check BUSY
|
| Station names visible but ports all show 0 | Library version mismatch with TIA Portal version | Re-download the version of the library that matches the active TIA Portal (V15.1 / V16 / V17 / V18) |
| Some UDT members populated, others empty | Switch has fewer ports than the UDT array, or some ports are administratively disabled | Size the UDT to the actual port count of the SCALANCE; check WBM for port state |
| Need IP address of connected device | Out of scope of ReadGlobalInfo
|
Use SINEC PNI on the engineering PC or maintain a project-side station-name-to-IP table |
Version Compatibility Notes
The LPNDR library is republished for each major TIA Portal release. Known releases:
- TIA Portal V15.1 — original release used in the source project
- TIA Portal V16 — current target release (most widely deployed on S7-1500 systems as of 2024–2025)
- TIA Portal V17 / V18 — updated library editions with extended record coverage
Opening a V15.1-era project in V16 with a V16 library will not break the existing FBs, but newer records (e.g. PortMirror, multicast filtering) are only available with the matching library version. Always check the readme inside the ZIP for the exact TIA Portal version the library was compiled against.
Related Documentation
- Siemens Support entry 109753067 – Library for PROFINET data records
- TIA Portal Cloud documentation: Diagnostics and configuration data records
- SCALANCE XC208 operating instructions (WBM chapter Layer 2 → LLDP and Information → Diagnostics)
- SINEC PNI user manual (Primary Network Initialization) for the engineering PC path
FAQ
Where do I download the LPNDR block library?
The library is published by Siemens as support entry 109753067 – Library for PROFINET data records. Download the ZIP, extract it, and open the .al16 global library in TIA Portal under Options → Global libraries → Open library.
Can LPNDR_ReadGlobalInfo return the IP address of devices connected to a SCALANCE XC208?
No. The PDIRData / GlobalInfo record (index 0x0001) returns the station name, MAC address, port list, and slot/port mapping — but not the IP configuration. For IP discovery use SINEC PNI on the engineering PC or maintain a project-side station-name-to-IP table.
Why is the UDT empty even though the FB returns DONE?
Most often the LADDR input is wrong: the value must be the Hardware identifier of the SCALANCE from the TIA Portal device configuration, not its IP address or PROFINET name. Open the SCALANCE device properties and copy the HW identifier from the system constants.
Which TIA Portal version do I need?
Match the library version to the active TIA Portal: V15.1, V16, V17, or V18 editions exist. A V15.1 library will open in V16 but newer records (PortMirror, etc.) are only available in the matching edition. The project's PLC must be a SIMATIC S7-1200 or S7-1500 — the LPNDR blocks do not run on S7-300/400 or on the older S7-200.
How often should I call LPNDR_ReadGlobalInfo?
Call it on a 1–10 s interval using a clock generator. Each record read on an S7-1500 typically takes 30–80 ms; on an S7-1200 it can be 150–300 ms. Calling it every PLC scan will produce STATUS = 0x0000_81xx (busy) and leave the UDT unpopulated.