Configuring S7 Connection: S7-300 315-2PN/DP to CP 343-1 Lean

David Krause14 min read
S7-300SiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

Linking a Siemens S7-300 CPU 315-2PN/DP (PROFINET-capable) to a sibling S7-300 CPU 315-2DP that has been expanded with a CP 343-1 Lean is one of the most common field configurations in STEP 7 / SIMATIC Manager. The PN side of the 315-2PN/DP can speak S7 communication natively, but the 315-2DP does not have a PROFINET port; the CP 343-1 Lean (6GK7 343-1CX10-0XE0) is added precisely to provide that PROFINET interface and S7 connection resources on the DP side. The result is two S7-300 stations bridged by an industrial Ethernet subnet, exchanging process data through the classic PUT/GET mechanism.

This article covers the engineering flow: hardware identification, STEP 7 / SIMATIC Manager project setup, the asymmetric one-sided S7 connection in NetPro (because the CP 343-1 Lean can only function as an S7 server), the placement of PUT/GET blocks, and the verification and troubleshooting checks that catch the typical commissioning mistakes.

Hardware and Software Prerequisites

Component Article Number Notes
CPU 315-2PN/DP 6ES7 315-2EH14-0AB0 (FW V3.2 / V3.3) Acts as S7 client and S7 server on its PN port
CPU 315-2DP 6ES7 315-2AH14-0AB0 (FW V3.3) PROFIBUS DP master, no PROFINET port
CP 343-1 Lean 6GK7 343-1CX10-0XE0 PROFINET IO device + S7 connection server only; max 4 S7 connections for PG/OP/HMI
STEP 7 / SIMATIC Manager V5.5 + SP2 (or V5.6) with HW update Alternatively TIA Portal V13 or higher for the PN station
Industrial Ethernet switch e.g. SCALANCE XC-208 (6GK5 208-0BA10-2AA3) Any 100 Mbit/s managed/unmanaged switch is acceptable for S7 communication
Ethernet cabling PROFINET patch cable, Cat 5e or higher RJ45 connectors per IEC 61754-24
The CP 343-1 Lean is identified by the order number 6GK7 343-1CX10-0XE0. The "CX10" suffix denotes the Lean variant; it must not be confused with the standard CP 343-1 (6GK7 343-1EX30-0XE0) or the CP 343-1 Advanced. The Lean variant is firmware-locked to S7-server role for connection partners and therefore imposes the asymmetric configuration described in the next section.

Understanding the CP 343-1 Lean S7 Server Limitation

The CP 343-1 Lean is built around a reduced protocol stack. It supports PROFINET IO Device mode and S7 communication, but only in the direction reactive. The CP cannot open an S7 connection; it can only accept one. In Siemens documentation this is described by saying the CP acts as the S7 server, never as the S7 client. See the CP 343-1 Lean operating instructions (Siemens Support entry 109751174) for the official definition of supported connection types and connection count.

Consequences for the project:

  • All S7 connection initiative must originate on the 315-2PN/DP side, which acts as the S7 client.
  • In NetPro, an S7 connection is created at the PN station, and the CP-Lean is selected as the partner. A local connection ID is generated only on the PN-CPU side; the CP-Lean side is greyed out because the local application on that side is not involved in establishing the connection.
  • The connection is therefore one-sided from the application perspective: the 315-2PN/DP owns the ID, and the user program that calls PUT/GET must live in the 315-2PN/DP. No program is needed inside the 315-2DP that hosts the CP-Lean beyond the standard OB1 / OB82 / OB86 / OB87 fault handling.

This is the root of the most common commissioning confusion: engineers expect to see a "partner ID" on the CP-Lean side and they expect to program PUT/GET in the 315-2DP. Both expectations are wrong because of the hardware-imposed server role.

NetPro Configuration Procedure

  1. Insert the PN station. In SIMATIC Manager, create a new S7-300 station, open HW Config, and insert a Rack-0 with PS 307 5A, CPU 315-2PN/DP (order number as above), and digital I/O placeholders if required. Save and compile.
  2. Insert the DP station. Add a second S7-300 station with CPU 315-2DP. In the DP station's HW Config, slot the CP 343-1 Lean in slot 4 (the only supported slot for the CP in an S7-300). Assign a unique IP address on the same subnet as the PN port of the 315-2PN/DP, e.g. 192.168.0.11 for the PN-CPU and 192.168.0.12 for the CP-Lean. Subnet mask 255.255.255.0; no router required.
  3. Create an Ethernet subnet. In NetPro, right-click the PN port of the 315-2PN/DP and choose New Subnet > Industrial Ethernet. Drag the CP-Lean's PN port onto the same subnet so that both stations are connected to the same Ethernet bus.
  4. Insert an S7 connection. Right-click the CPU 315-2PN/DP and choose Insert New Connection. The connection partner dialog offers the CP 343-1 Lean as a valid partner (it appears in the partner list because it is a member of the same STEP 7 project). Select S7 connection as the connection type and click Apply.
  5. Inspect the connection properties. Open the connection by double-clicking it. Note:
    • On the General tab the Local ID field contains a value, e.g. 1. This is the only ID your STEP 7 program will need to reference.
    • The Connection Partner panel is non-editable; the partner end is the CP-Lean and the path is via the configured Ethernet subnet.
    • On the Address Details tab the partner IP 192.168.0.12 and Rack/Slot of the CP-Lean are stored. Leave the rack/slot at the CP's slot value (slot 4, slot 0 for the internal S7 interface of the CP).
  6. Save and compile the connection. Save NetPro and download the hardware configuration to both stations. The 315-2PN/DP receives a connection table entry; the CP-Lean receives only the partner-end binding. There is no separate connection block to download on the DP side.
If the partner list in step 4 does not show the CP-Lean, verify that the CP is configured with a PN interface (it must have an Ethernet port assigned in HW Config) and that the CP-Lean station is a member of the same STEP 7 project. CP 343-1 Lean stations imported from a GSD file (i.e. PROFINET IO Device mode from a third-party controller's perspective) will not appear in the S7 connection partner list.

PUT/GET Block Programming in the PN CPU

All application-level exchange of process data is handled by the function blocks FB 14 GET and FB 15 PUT (or the system blocks SFB 14 / SFB 15 if you prefer the integrated version). These are located in the STEP 7 Standard Library under Communication Blocks. The block must be instantiated once, called cyclically from OB1, and supplied with the connection ID discovered in step 5 above.

Instance DB and call interface

Insert FB 14 in a cyclic OB such as OB1, assign an instance DB (e.g. DB 100 for GET, DB 101 for PUT), and populate the input pins as shown below.

FB 14 GET — read from the 315-2DP via CP-Lean

CALL  "GET" , "DB_GET"   // FB 14, instance DB 100
  REQ    := M10.0        // rising edge triggers a read job
  ID     := 1            // local connection ID from NetPro
  NDR    := M10.1        // new-data ready flag
  ERROR  := M10.2        // error flag
  STATUS := MW12         // status word (see fault code table)
  ADDR_1 := P#DB20.DBX0.0 BYTE 20   // partner data area
  RD_1   := P#DB30.DBX0.0 BYTE 20   // local destination area
END_CALL

FB 15 PUT — write to the 315-2DP via CP-Lean

CALL  "PUT" , "DB_PUT"   // FB 15, instance DB 101
  REQ    := M11.0        // rising edge triggers a write job
  ID     := 1            // local connection ID from NetPro
  DONE   := M11.1        // job complete flag
  ERROR  := M11.2        // error flag
  STATUS := MW14         // status word
  ADDR_1 := P#DB21.DBX0.0 BYTE 20   // partner target area
  SD_1   := P#DB31.DBX0.0 BYTE 20   // local source area
END_CALL

The REQ triggers are normally driven by a clock memory bit or a hand-shake flag. With the CP-Lean, the maximum useful payload per call is 76 bytes per ADDR_1/RD_1 / SD_1 pair when using S7-300 to S7-300; if the application needs more than 76 bytes per transfer, you must use ADDR_2/RD_2 / SD_2 in the same block call. The block is documented in the STEP 7 online help under FB 14 GET / FB 15 PUT.

Status word interpretation

STATUS (hex) Meaning Recommended action
0000 No error None
001F Job still active Wait; do not retrigger REQ
0081 Remote partner has not been reached (connection broken) Check Ethernet cable, switch, partner IP; verify that the CP-Lean is in RUN
0082 Local resource shortage (no free connection) CP-Lean allows max 4 S7 connections; reduce count
0083 Partner resource shortage Check partner's S7 connection count; reduce other clients on the partner CPU
0084 Connection establishment error (protocol) Verify connection is downloaded to both stations; check Rack/Slot in NetPro
00A0 Negative acknowledgement from partner; access to partner memory denied Verify the partner data block exists and has the right length; check write protection on partner DB
00A1 Partner reports a write-protected object Remove DB write protection or pick a different data area
00A2 Object does not exist on partner Confirm DB number and length on the partner CPU

Full status word codes are listed in the Siemens FAQ entry 18610307 ("How do you program communication blocks FB 14 GET and FB 15 PUT?") and in the STEP 7 Online Help for the block itself.

Verifying the Connection

After download, the connection can be validated without exercising the user program by using the STEP 7 diagnostic tools.

  1. Online > Accessible Nodes in SIMATIC Manager. The CP-Lean must appear with its IP 192.168.0.12 and the PN-CPU with its IP 192.168.0.11. If either station is missing, isolate the cable and switch.
  2. Right-click the S7 connection in NetPro and choose Connection Status > Status. With the PN-CPU online, the diagnostic window displays the connection state established when the partner is reachable and the connection is configured on both sides. A not established state at this point usually means the partner station has not yet downloaded the new connection, or the CP-Lean is in STOP.
  3. Monitor the FB instance DB online. After triggering REQ, watch NDR (GET) or DONE (PUT) toggle and ERROR remain 0. If ERROR becomes 1, latch the value of STATUS for the fault table lookup.
  4. Test with VAT (Variable Table). Force a value into the source DB (e.g. DB 31) on the PN-CPU, trigger the PUT job, and read the partner DB on the DP station with a separate VAT. The value should appear within one cycle of the OB1 scan plus the network round-trip time (typically 10-30 ms on a lightly loaded switch).

Troubleshooting Matrix

Symptom Most likely cause Diagnostic step Fix
STATUS 0081 on every call Ethernet physical layer or CP-Lean in STOP Check the SF/BF LEDs on the CP; ping CP-Lean from PG Re-seat the CP, restore the cable, transition CP-Lean to RUN
STATUS 0084 at first call Connection not downloaded to partner NetPro > highlight partner station > Download Selected Stations Download the configuration to the 315-2DP station
STATUS 00A0 on PUT, but GET works Partner DB write-protected or missing Open partner DB properties in HW Config or NetPro Uncheck Block read-only / write-protected on the partner DB
STATUS 00A2 on PUT or GET Partner DB number or length mismatch Compare ADDR_1 with actual partner DB Correct the pointer so that the partner DB exists and is at least BYTE N long
Connection "not established" in NetPro CP-Lean not configured for the S7 function (PROFINET IO only mode selected) HW Config > CP-Lean properties > Options tab Enable the S7 connection option and re-download
Connection works for 60-90 s, then breaks Keep-alive timer expired due to firewall or VLAN filtering on the switch Inspect switch configuration; check the SF LED on the CP Open UDP port 102 in the firewall; remove the VLAN ACL
Only the first PUT call succeeds REQ not pulsed Online monitor the REQ bit Use a one-shot rising-edge from a clock memory bit or from DONE
Data is read but contains the previous value RD_1 destination is being overwritten by other logic Cross-reference RD_1 in the PN-CPU Move RD_1 to a dedicated DB not used by any other logic
Connection status shows "established" but no data Wrong Rack/Slot for the CP-Lean in the partner end NetPro > Address Details Set Rack=0, Slot=4 for the CP-Lean's internal S7 interface

Edge Cases and Field-Proven Caveats

  • Connection count limit. The CP 343-1 Lean allows a maximum of 4 S7 connections for OP / PG / HMI in total, which includes the connection to the 315-2PN/DP. If an HMI panel and a PG also use the same CP for diagnostics, you may run out of slots and see STATUS 0082. Plan the connection count carefully before adding the 315-2PN/DP link.
  • Cross-project connections. If the 315-2DP with CP-Lean belongs to a different STEP 7 project than the 315-2PN/DP, the "unknown partner" wizard must be used. In that case the partner end is configured manually with the CP-Lean's IP and the Rack/Slot of the CP. The connection remains one-sided from the application perspective, and only the PN-CPU sees a local ID.
  • Consistent data blocks. When reading or writing more than 8 bytes, the partner DB should be configured as a consistent data area only if the application needs atomic reads/writes. The SFB/FB blocks, however, already perform coordinated transfers at the communication level, so a non-consistent DB is normally sufficient and is easier to maintain.
  • Replacing the CP with the standard CP 343-1. If a future upgrade moves from the Lean CP to the standard CP 343-1 (6GK7 343-1EX30-0XE0) or the Advanced variant, the partner becomes a full S7 client. The NetPro connection must then be regenerated as a two-sided connection, and the application logic in the 315-2DP can be expanded to use PUT/GET locally as well. The 315-2PN/DP can keep its existing application unchanged; only the partner end of the connection object is changed.
  • PROFINET IO coexistence. The CP 343-1 Lean is also a PROFINET IO Device. The S7 connection to the 315-2PN/DP and the PROFINET IO arbitration share the same Ethernet interface and the same MAC. In busy installations the S7 communication may suffer when large IO updates compete for bandwidth. Switch to a managed switch and isolate the IO traffic on a separate VLAN if the S7 job latency becomes a problem.
  • TIA Portal translation. If the project is migrated to TIA Portal V15 or later, the CP-Lean appears in the device catalog under Communications module > CP 343-1 Lean. The connection configuration in Devices & Networks uses the same S7 connection type. The function blocks FB 14 / FB 15 still work, but TIA Portal also offers the more compact PUT/GET instruction in the Communication palette, which auto-generates an instance DB.

Safety and Commissioning Notes

The S7 connection established with PUT/GET provides no inherent safety integrity. If the application exchanges safety-relevant data, the standard PROFINET IO / PROFIsafe stack on the CP 343-1 Lean must be used instead, or a separate safety controller. The CP 343-1 Lean is not PROFIsafe-capable. The 315-2PN/DP can run PROFIsafe on its own PROFINET port independently.

During commissioning, force the OB1 scan rate to a slow value (e.g. 500 ms) and watch the connection status before going to faster scan rates. The 315-2PN/DP will show the connection in STOP as long as the CP-Lean is not reachable. Always keep an ESD wrist strap and follow the S7-300 grounding rules when seating or reseating the CP 343-1 Lean; the module is sensitive to hot insertion damage.

FAQ

Why does the CP 343-1 Lean not show a connection ID in NetPro?

Because the CP 343-1 Lean is a S7 server only. The local connection ID is generated on the partner end (the 315-2PN/DP), which is the S7 client and the only side that can actively establish the connection. Open the connection object on the PN-CPU side to see the local ID.

Can I program PUT/GET in the 315-2DP that hosts the CP-Lean?

No. The CP-Lean cannot act as an S7 client, so it cannot open a connection. All PUT/GET calls must reside in the 315-2PN/DP. The 315-2DP with CP-Lean requires no communication program beyond the standard OB1 fault OBs.

What is the maximum amount of data per PUT or GET call?

For S7-300 to S7-300, each ADDR_n/SD_n/RD_n pointer can be up to 76 bytes. Use the second pointer (ADDR_2, SD_2, RD_2) of the same block call to transfer up to 152 bytes per call without splitting the user data across multiple jobs.

How do I tell whether the S7 connection is currently up?

Open the connection in NetPro with the PN-CPU online and select Connection Status. Alternatively, evaluate the STATUS output of the PUT/GET block: 001F means a job is in progress, while codes in the 008x/00Ax range indicate that the connection itself is not in an established state.

Can the CP 343-1 Lean connect to a third-party S7 client?

Yes. As an S7 server, the CP-Lean will accept any RFC 1006 (ISO-on-TCP) S7 connection request from a partner. However, the partner must still be configured with the CP-Lean's IP, rack and slot, and the partner must initiate every read or write with PUT/GET or its equivalent. The CP-Lean never initiates communication on its own.

Back to blog