Configuring CP343-1 to PC HMI Communication with WinCC Flexible
Field reference. A SIMATIC S7-300 PLC equipped with a CP 343-1 communications processor exchanges process data with a PC-based HMI (for example, a Gefran PC Touch operator terminal) running WinCC Flexible Runtime. The S7 protocol is carried over ISO-on-TCP (RFC 1006), giving you an Ethernet-based, deterministic, vendor-managed channel without the overhead of an external OPC server. This guide covers hardware selection, STEP 7 configuration on both ends of the link, the WinCC Flexible project, runtime licensing, commissioning checks, and a troubleshooting matrix drawn from real field interventions.
1. System Architecture
The classical arrangement is a star or line topology on Industrial Ethernet. The S7-300 mounts the CP 343-1 in slot 4 (typical configuration), assigned an IP address and a transport service access point (TSAP) pair. The PC station runs WinCC Flexible Runtime with a parallel S7 connection pointing at the CP 343-1. The S7 protocol suite handles read, write, bit-test, and PUT/GET primitives, while ISO-on-TCP (RFC 1006) provides reliable, full-duplex transport on top of TCP port 102.
| Participant | IP address (example) | Role | Driver / FW |
|---|---|---|---|
| CP 343-1 (6GK7343-1EX30-0XE0) | 192.168.0.1 | S7 server | Firmware V3.x |
| PC Touch Gefran II (or engineering PC) | 192.168.0.10 | S7 client (HMI) | WinCC Flexible RT 2008 SP5 |
| STEP 7 programming station | 192.168.0.100 | Configuration + online | STEP 7 V5.5 / V5.6 SP1 |
2. Prerequisites and Bill of Materials
- Hardware. S7-300 (CPU 312/314/315/317-2 DP/PN) with a free slot for the CP, a CP 343-1 variant matched to the firmware family, an Industrial Ethernet switch (managed or unmanaged, SCALANCE X-100/X-200 is recommended for noisy cabinets), and a PC or panel PC with at least 1 Gbit Ethernet.
- Cabling. Cat 5e or higher, RJ45, max 100 m per segment. For >100 m, use a SCALANCE switch in the path.
- Software on the engineering station. STEP 7 V5.5 or V5.6 SP1, plus WinCC Flexible 2008 SP5 (Compact, Standard, or Advanced — Advanced is required for the PC runtime scenario). Service Pack level matters: SP3 and earlier do not support all CP 343-1 firmware revisions.
- Software on the target PC / panel. WinCC Flexible Runtime 2008 SP5 (or matching service pack). License key transferred via Automation License Manager (ALM).
- Network parameters. Static IP addresses (DHCP is not advisable for industrial control), unified subnet, identical gateway for routed topologies, and a defined naming convention.
| Article number | Variant | Firmware | Max S7 connections |
|---|---|---|---|
| 6GK7343-1EX30-0XE0 | CP 343-1 | V3.0 | 16 |
| 6GK7343-1EX21-0XE0 | CP 343-1 (legacy) | V1.x | 16 |
| 6GK7343-1GX30-0XE0 | CP 343-1 IT | V3.0 | 16 + Web |
| 6GK7343-1HX00-0XE0 | CP 343-1 PN | V3.0 | 16 + PROFINET IO controller |
| 6GK7343-1GX31-0XE0 | CP 343-1 Advanced | V3.0+ | 32 + FTP + Web + IT |
3. Protocol Stack: S7 over ISO-on-TCP
ISO-on-TCP is the canonical Siemens transport for S7 communication on Industrial Ethernet. It encapsulates ISO 8073 COTP (Connection-Oriented Transport Protocol) inside RFC 1006, which in turn rides on standard TCP. The wire stack, from the top down, looks like this:
-
S7 protocol. Carries the S7 user data — variable read/write, block services, security, time sync, PUT/GET, and diagnostic information. Functions of interest:
-
0x04— Read Var -
0x05— Write Var -
0x1D— Download Block -
0x1E— Download Ended -
0x1F— Insert Start -
0x00— CPU Stop / Start / Warm Restart requests
-
- COTP (ISO 8073). Connection establishment (CR/CC), data (DT), and disconnect (DR). Provides the TSAP addressing that distinguishes multiple S7 applications on the same host.
- TPKT (RFC 1006). 4-byte header carrying the length of the enclosed COTP PDU. TPKT version is always 3.
- TCP / IP. Standard transport. S7 uses TCP port 102 for both the server (CP 343-1) and the client (WinCC Flexible RT).
The TSAP is the most common field-error source. A TSAP is a two-byte local/remote pair, formatted as a string of the form xx.yy in STEP 7. The first byte is the connection resource, the second is the slot of the CP. For an S7-300 CP in slot 4 with rack 0:
Local TSAP : 01.04
Remote TSAP : 02.01 (or the WinCC Flexible partner ID you set)
4. CP 343-1 Hardware Configuration in STEP 7
- Open the SIMATIC Manager project and double-click HW Config on the S7-300 station.
- Insert the CP 343-1 from the hardware catalog under SIMATIC 300 > CP-300 > Industrial Ethernet into slot 4 of the rack (slot 4 is the conventional CP slot for the S7-300; the CPU occupies slot 2 or 3, IM in slot 3, free slots to the right).
- Open Object Properties > Interface > Ethernet and assign:
- IP address:
192.168.0.1 - Subnet mask:
255.255.255.0 - Use router: unchecked (for flat topology)
- IP address:
- Open Object Properties > Connection and add a new ISO-on-TCP connection with unspecified partner (this is the S7 connection that WinCC Flexible will use). Fill in the local and remote TSAP as above. The CP 343-1 holds up to 16 such S7 connections; each occupies a connection resource in the CPU.
- Compile and download the hardware configuration to the CPU. The CP performs a restart and accepts S7 connections only after the CPU is in RUN.
Verify the configuration by opening Online > Accessible Nodes from STEP 7. The CP 343-1 must appear with its MAC and IP. If the entry is missing, you have a layer-1/2 problem — check the LINK LED on the CP and the switch port.
5. PC Station and WinCC Flexible RT Configuration
The PC station is a logical container that links the engineering view of the HMI to the runtime on the operator panel. There are two configuration surfaces: the PC station in STEP 7 (which registers the HMI as an S7 client) and the connection in the WinCC Flexible project itself.
- In SIMATIC Manager, insert a PC Station next to the S7-300 station.
- Open the PC station's hardware configuration and insert an WinCC Flexible RT application in slot 1 and an IE General (CP-IE) or a soft-net Ethernet card in slot 2. Assign the IP address
192.168.0.10to the IE card. - Compile the PC station and download it. The PC-side HMI service is now visible to the CP 343-1 as an S7 client.
- Open the WinCC Flexible project, switch to Connections, and add a new connection:
- Name: keep default or use a numeric name
- Driver: S7-300/400 over TCP/IP (this is the WinCC Flexible RT internal driver; it does not require SIMATIC NET)
- PLC address:
192.168.0.1 - Rack / Slot of PLC CPU:
0 / 2(or whatever the CPU slot is in your HW Config)
- Build the project, transfer it to the panel, and start Runtime.
6. Tag Mapping: Bits, Bytes, Words, and Data Blocks
The S7 protocol can address every memory area of the CPU: inputs (I), outputs (Q), merkers (M), peripheral I/O (PI/PQ), and data blocks (DB). WinCC Flexible mirrors these areas 1:1; each HMI tag points to a concrete address in the PLC.
| PLC area | Syntax | Example | Notes |
|---|---|---|---|
| Input bit | I a.b |
I 0.0 |
a = byte, b = bit (0..7) |
| Output bit | Q a.b |
Q 0.7 |
Read/write from HMI |
| Merker bit | M a.b |
M 10.3 |
Volatile, OK for HMI status |
| Data block bit | DB x.DBX a.b |
DB 100.DBX 0.0 |
Most common for structured data |
| Data block word | DB x.DBW a |
DB 100.DBW 4 |
16-bit word, big-endian |
| Data block dword | DB x.DBD a |
DB 100.DBD 8 |
32-bit double word |
| Data block real | DB x.DBD a (REAL) |
DB 100.DBD 12 |
IEEE 754 float, 32 bits |
Word-swap caveat: the S7 protocol stores words in big-endian, while x86 PCs and most HMI SCADA engines expect little-endian. The CP 343-1 handles the conversion transparently, but if you cross-compile data from a Modbus gateway or a panel that uses SWAP, the displayed value will be byte-reversed. Keep one endianness convention per project to avoid hunting phantom bugs.
Recommended approach: reserve a dedicated DB (commonly DB 100) for HMI data exchange. Lay it out as a fixed structure with named variables. WinCC Flexible can be linked to the STEP 7 symbol table so the engineering effort happens once.
7. PLC Program Patterns for HMI Data Exchange
The simplest HMI exchange is direct tag polling: WinCC Flexible issues cyclic READ_VAR on configured tags, and the CPU responds without any PLC code. This is sufficient for status display, setpoint write-back, and acknowledgment bits.
For bulk transfers, the PLC uses the S7 communication functions. On S7-300, the standard blocks are FC 5 (AG_SEND) and FC 6 (AG_RECV), callable from any OB. On S7-400 and on newer S7-300 CPUs, the integrated SFB 12 (BSEND) / SFB 13 (BRCV) provide a more efficient stream-oriented alternative. For HMI-to-HMI or HMI-to-PG copy jobs, the PG/PC side issues a PUT or GET primitive that the CP 343-1 maps onto the configured S7 connection without PLC code on the partner side, provided the target area is not write-protected.
Sample FC call in STL for an AG_SEND of 200 bytes from DB 100 to a remote partner via connection ID 1:
CALL "AG_SEND"
ACT := TRUE
ID := 1 // S7 connection ID
LADDR := W#16#0100 // Logical base address of CP 343-1
SEND := P#DB100.DBX0.0 BYTE 200 // Source pointer
LEN := 200
DONE := M10.0
ERROR := M10.1
STATUS := MW12
NOP 0;
Sample SCL (structured control language) version in an FC cycle for the matching AG_RECV on a separate OB1 call slot:
IF "recv_trigger" THEN
"AG_RECV_Block"(ID := 1,
LADDR := 16#0100,
RECV := P#DB110.DBX0.0 BYTE 240,
NDR => "recv_ndr",
ERROR => "recv_err",
STATUS => "recv_status",
LEN => "recv_len");
END_IF;
Make sure the CP 343-1 hardware address (LADDR) matches the I/O address of the CP in HW Config. The default is 0100 hex for a CP in slot 4 with the standard address assignment; verify in HW Config > CP343 > Object Properties > Addresses.
8. Building the WinCC Flexible Project
- Connections. Open the Connections editor and confirm the S7-300/400 over TCP/IP entry points to the CP 343-1's IP, rack, and slot. Save and rebuild.
- Tags. Create internal and external tags. For external tags, select the connection and enter the PLC address from Table 3. Use symbolic names if STEP 7 integration is enabled (Options > STEP 7 Symbol Table Integration).
-
Area pointers. WinCC Flexible uses area pointers to exchange non-tag data, including:
- Coordination — startup and lifetime handshake between RT and PLC
- Date/Time — time sync from PLC to RT
- Project ID — runtime consistency check
- Job mailbox — control commands for recipes, screen selection, password reset
- Screens. Add I/O fields, buttons, and alarms bound to the configured tags. Use the connection's tag quality display to expose communication faults in operator-friendly form.
- Alarms. Discrete alarms can be triggered by tag edges (HMI-side) or by bit messages from the PLC. Use bit messages for guaranteed delivery in a coordinated system.
- Recipes. Recipe data is stored in the RT machine database and transferred to the PLC on demand. Define a recipe DB (e.g., DB 50) of 200 to 800 bytes typical. WinCC Flexible generates a UDT in STEP 7 if you choose to compile recipes into the PLC.
9. Runtime Licensing and Power-Tag Budget
WinCC Flexible Runtime is licensed by the number of power tags. A power tag is a tag that participates in logging, alarming, or trending, or that is read from or written to the PLC cyclically with a settable acquisition cycle. Pure display tags used only in screen objects with no logging, no alarming, and the default 1 s update do not count as power tags in the conservative interpretation; check the exact rule in the WinCC Flexible manual for the specific version.
| License | Power tags | Article number | Use case |
|---|---|---|---|
| RT 128 | 128 | 6AV6613-1BA01-1CA0 | Small machines |
| RT 256 | 256 | 6AV6613-1CA01-1CA0 | Mid-size lines |
| RT 512 | 512 | 6AV6613-1DA01-1CA0 | Large cells |
| RT 2048 | 2048 | 6AV6613-1EA01-1CA0 | Plant-wide SCADA |
| RT 4096 | 4096 | 6AV6613-1FA01-1CA0 | High-density processes |
Transfer the license via the Automation License Manager (ALM). The license is bound to the panel's hard disk serial number (volume serial). If you swap the panel's storage, plan for a license reclamation through the Siemens license portal.
10. Commissioning and Verification
- Layer 1 — physical. LINK LED on the CP 343-1 solid green, LINK LED on the PC Ethernet port solid green. Cable tester shows all four pairs wired (for 100BASE-TX) and within length spec.
-
Layer 2/3 — network. From the PC, ping the CP IP.
ping 192.168.0.1 -twith -t on Windows; the first ping can take up to 2 s while the CP populates its ARP cache. Subsequent pings should be < 1 ms on a switched network. - Layer 7 — application. Start WinCC Flexible RT. Open the Diagnostics view (Project > RT > Diagnostics). The connection line should be solid green, with a tag count and a cycle time displayed.
- Tag-level verification. Use the tag simulator in WinCC Flexible (Tools > Tag Simulation) or, in the running RT, use a tag test with a forced value. Confirm the value reflects in the PLC by monitoring in STEP 7 online (for tags in M or DB areas).
- CP diagnostics buffer. In STEP 7, PLC > Diagnostic/Setting > Diagnostic Buffer. There should be no entries of class Connection with status codes 0x0206 (partner not reachable) or 0x0401 (TSAP mismatch).
11. Troubleshooting Matrix: LEDs, Diagnostic Buffer, and Tags
| SF | BF | LINK | RX/TX | Likely cause |
|---|---|---|---|---|
| off | off | green | blinking | Healthy. S7 traffic in progress. |
| off | red steady | green | off | No Ethernet link or partner unreachable. Check cable, switch, partner IP. |
| off | red flashing | green | off | TCP connection attempt failing. Verify WinCC Flexible RT is running and the configured IP matches. |
| red steady | off | green | off | Configuration error. Open CP 343-1 in HW Config and check for download mismatch or missing firmware. |
| red steady | red steady | off | off | No power or module defective. Check 24 V supply and backplane. |
| red flashing | red flashing | off | off | Firmware update in progress or failed. Do not power-cycle. |
| Event ID | Meaning | Remediation |
|---|---|---|
| 0x0101 | Connection established | Informational, no action |
| 0x0102 | Connection terminated | Check partner for restart, network stability |
| 0x0206 | Partner not reachable, TCP RST | Verify IP, port 102, firewall on PC |
| 0x0301 | Connection resource exhausted (16 max) | Close unused connections, or upgrade to CP 343-1 Advanced (32) |
| 0x0401 | TSAP mismatch | Compare local/remote TSAP; check connection name in WinCC Flexible |
| 0x0500 | Partner terminated with reason | Inspect partner diagnostic buffer (the PC side, if available) |
| 0x0E01 | Authentication/Access denied | Check CPU protection level, password, and the connection's write permissions |
| Quality flag | Meaning | Operator action |
|---|---|---|
| Good (0xC0) | Value is current and trusted | None |
| Bad (0x00) | Communication lost or address invalid | Show "No Connection" on screen, alarm |
| Uncertain (0x40) | Initial value, not yet updated | Display placeholder |
| Substituted | RT is showing last known value | Verify timestamp, alarm on staleness > 2× update cycle |
0x0206.12. Best Practices and Migration Path
- Keep WinCC Flexible 2008 SP5 or move to TIA Portal. WinCC Flexible is end-of-life for new development. New projects should use TIA Portal V17/V18 with WinCC Comfort, Advanced, or Professional. The migration tool converts a WinCC Flexible project to a TIA Portal project and re-maps the S7-300/400 connection to an HMI connection on the TIA-side S7-1500 or S7-300 target.
- Reserve a coordination DB. A small DB (e.g., DB 99) holding the coordination pointer, date/time, and project ID is essential. It is the runtime handshake that WinCC Flexible needs to start cleanly.
- Use a managed switch. For shop-floor panels, a SCALANCE XC-100 or XB-200 series managed switch gives you SNMP, port diagnostics, and redundancy features that pay back quickly during commissioning and aftercare.
-
Tag naming convention. Adopt a single tag prefix per area (e.g.,
HMI_StartPermit,MOT_RunCmd) so that the WinCC Flexible project remains maintainable. Import the STEP 7 symbol table directly. - Substitute a CP 343-1 Advanced for >16 connections. The standard CP 343-1 supports 16 S7 connections total. If your PC runtime, a PG, an OPC server, and a couple of PUT/GET partners are already in the budget, the limit is reached quickly. The Advanced variant doubles the budget and adds IT functions.
- Plan for PLC runtime. A 1 s update cycle on 100 tags generates 100 S7 read requests per second. On a CPU 315-2 DP, this is negligible. On a CPU 312, allocate connection resources carefully and consider increasing the cycle to 2 s for non-critical tags.
Frequently Asked Questions
Do I need SIMATIC NET or SOFTNET S7 on the PC for WinCC Flexible Runtime to talk to a CP 343-1?
No. WinCC Flexible Runtime includes a built-in S7-300/400 driver that speaks ISO-on-TCP directly to the CP 343-1. SIMATIC NET is only required if you need additional S7 connections beyond the built-in driver (for example, an OPC server alongside WinCC Flexible).
How many power tags can I use with each WinCC Flexible Runtime license?
The license tiers are 128, 256, 512, 2048, and 4096 power tags (article numbers 6AV6613-1BA01-1CA0 through 6AV6613-1FA01-1CA0). Power tags are tags involved in logging, alarming, trending, or cyclic PLC read/write with a configurable acquisition cycle. Display-only tags used with the default 1 s acquisition do not count as power tags in most interpretations.
What TSAP should I configure for the S7 connection from the CP 343-1 to WinCC Flexible?
For an S7-300 CP 343-1 in rack 0, slot 4, the local TSAP is typically 01.04. The partner (remote) TSAP can be left at the WinCC Flexible default 02.01, which the driver fills in automatically when the connection name is the default. If you assign a non-numeric connection name in WinCC Flexible, the driver derives a different TSAP and the CP will log a 0x0401 TSAP mismatch — keep connection names numeric or use the default.
Why does the CP 343-1 show a steady SF LED after hardware download?
A steady SF LED with LINK green and BF off indicates a configuration error, most often a download mismatch between the CPU and the CP, or a firmware version on the CP that the project's hardware catalog does not support. Re-compile and re-download the HW Config, and verify the CP's firmware revision in the module's diagnostic buffer.
How do I migrate a WinCC Flexible project to TIA Portal / WinCC Professional?
Open the WinCC Flexible project in TIA Portal via Project > Migrate project. TIA Portal converts the screens, tags, alarms, and recipes and re-creates the S7-300/400 connection as a TIA HMI connection. The PLC program must also be migrated to TIA Portal (or the S7-300 target must be reachable from a TIA Portal project). After migration, recompile and re-test all tag connections, because area pointer offsets occasionally shift.
What is the maximum number of S7 connections supported on a CP 343-1?
The standard CP 343-1 (6GK7343-1EX30-0XE0) supports up to 16 S7 connections. The CP 343-1 Advanced (6GK7343-1GX31-0XE0) supports up to 32. Each WinCC Flexible RT, each OPC client, and each PUT/GET partner consumes one connection resource, so size accordingly.