Writing Data from WinCC 7.0 to a SIMATIC S7-300 PLC
WinCC 7.0 can write values to a SIMATIC S7-300 PLC through a configured driver connection, a WinCC tag bound to a memory address, and a screen object (typically an I/O field) connected to that tag. The relationship is bidirectional: an operator entering a value in WinCC updates the PLC, and a calculation in the PLC updates the WinCC tag.
This reference covers the end-to-end configuration: verifying the physical connection, creating the S7-300 channel in WinCC Tag Management, defining tags with the correct address format (MD/MW/DB), and binding an I/O field on a Graphics Designer screen to the tag so the operator can change the value at runtime.
1. Prerequisites and Architecture Overview
Before opening the WinCC Explorer, confirm the following items are available and operational. Each one is a hard dependency; missing any item produces runtime communication errors that surface as connection-status red icons in WinCC Explorer and tag-quality "bad" indicators on the runtime screens.
- Working PLC connection: An MPI, PROFIBUS, or ISO-on-TCP (Ethernet) link between the S7-300 station and the WinCC station. The CP 343-1 Lean / CP 343-1 (6GK7343-1CX10-0XE0 / 6GK7343-1EX30-0XE0) and CP 342-5 PROFIBUS (6GK7342-5DA02-0XE0) modules are the most common interfaces on the S7-300 side.
- WinCC 7.0 installation: SIMATIC WinCC V7.0 or later with the appropriate driver channel. For S7-300 communication, the channel "SIMATIC S7 Protocol Suite" is installed by default with the standard WinCC package.
- License: To modify a project, an RC (Development / Configuration) license is required. An RT (Runtime) license only permits the project to run; configuration changes cannot be saved.
- STEP 7 project (optional but recommended): STEP 7 V5.5 / V5.6 with the S7-300 program source. Knowing the absolute address of the variable (for example, MD 100, MW 200, or DB10.DBD0) is mandatory for tag configuration.
- TCP/IP or PROFIBUS address: For ISO-on-TCP, the S7-300 CP must have a configured IP address reachable from the WinCC station; for PROFIBUS or MPI, the bus parameters must match.
2. Establishing the S7-300 Communication Channel in WinCC
WinCC connects to a SIMATIC PLC through a "channel" inside the Tag Management editor. For S7-300 PLCs, the channel to use is the SIMATIC S7 Protocol Suite. Within that channel, a "connection" represents the logical link to one PLC, identified by its network address.
2.1 Open the Tag Management Editor
- Start WinCC Explorer and open your project (or create a new one: File > New > Single-User Project).
- In the left navigation tree, right-click Tag Management.
- Select Add New Driver → choose SIMATIC S7 Protocol Suite → click Open.
The SIMATIC S7 Protocol Suite exposes the following sub-channels; select the one that matches the physical interface between the WinCC PC and the S7-300 CP:
| Sub-channel | Physical medium | Typical use |
|---|---|---|
| MPI | RS-485 / PROFIBUS | Direct MPI link to S7-300 CPU (e.g., CPU 314 / 315 / 317 / 319) |
| PROFIBUS (DP) | RS-485 / PROFIBUS | Connection to S7-300 with CP 342-5 or onboard PROFIBUS DP port |
| Industrial Ethernet / ISO-on-TCP | TCP/IP | Connection to S7-300 with CP 343-1 Lean / CP 343-1 / onboard PROFINET port (PROFINET is configured as Ethernet on S7-300) |
| TCP/IP | TCP/IP | Native TCP/IP via S7-300 onboard Ethernet |
| Named Connections | Softnet S7 | Used when an S7 routing path is configured via PC station |
2.2 Create the Connection
- Expand the chosen sub-channel (for example, Industrial Ethernet).
- Right-click Industrial Ethernet → New Connection.
- In the Connection Properties dialog, set:
-
Name: any descriptive label, e.g.
S7_300_CP343 -
IP Address / Station Address: the IP of the S7-300 CP (e.g.,
192.168.0.10) or the MPI/PROFIBUS address (e.g.,2) -
Rack: typically
0 -
Slot: the slot of the CPU (typically
2for S7-300) - Connection Type: ISO-on-TCP (default for CP 343-1)
-
Name: any descriptive label, e.g.
- Click OK. The connection appears in the tree with a red dot (not yet tested).
3. Creating a Tag for the S7-300 Memory Address
Tags are the bridge between WinCC and PLC memory. A WinCC tag is associated with one absolute address in the S7-300. Common memory areas used for HMI access include:
-
Bit memory (M):
MX,MB,MW,MD -
Data blocks (DB):
DBx.DBXy,DBx.DBBy,DBx.DBWy,DBx.DBDy - Inputs/Outputs (I/Q): rarely used for HMI write-back due to safety implications
- Timers/Counters (T/C): also available but specialized
3.1 Procedure
- Right-click the newly created connection (e.g.
S7_300_CP343) → New Tag. - In the Tag Properties dialog:
-
Name: e.g.
SetpointValue -
Data type: select the type that matches the PLC variable (e.g.
Float 32-bit IEEE 754,Signed 32-bit,Word) -
Address: enter the S7-300 absolute address. For a double word in bit memory at byte 100, enter
MD 100. For a double word in DB10 starting at DBD0, enterDB10.DBD0. -
Update / Acquisition cycle: e.g.
1 s(minimum 500 ms; lower values increase network load)
-
Name: e.g.
- Click OK. The tag appears in the right pane with its full address.
| WinCC address field | PLC address | Description |
|---|---|---|
DB 10, DBD 0 |
DB10.DBD0 | 32-bit value, Data Block 10, double-word offset 0 |
DB 10, DBW 4 |
DB10.DBW4 | 16-bit value, Data Block 10, word offset 4 |
MD 100 |
MD100 | 32-bit value in bit-memory area, double-word offset 100 |
MW 200 |
MW200 | 16-bit value in bit-memory area, word offset 200 |
MB 50 |
MB50 | 8-bit value in bit-memory area, byte offset 50 |
The address field syntax must match exactly. Entering MD100 without the space, or selecting the wrong data type, causes the tag to read garbage or trigger an S7-300 "area length error" OB121 / SF LED on the CPU if a non-existent DB is referenced.
4. Binding an I/O Field on a WinCC Screen
The Graphics Designer is the WinCC editor for runtime screens. An I/O field (smart object) provides a configurable read/write input box that displays the current tag value and accepts operator entry.
4.1 Configure the Screen
- Open Graphics Designer (right-click Graphics Designer in the navigation tree → New Picture).
- From the Standard or Smart Objects palette, drag an I/O Field onto the picture.
- Double-click the I/O field to open its configuration dialog.
4.2 Configure the I/O Field
-
Tag: click the ... button and select the tag created in step 3 (e.g.
SetpointValue). -
Output / Input format: for a 32-bit integer, use
9999; for a real number, use999.99; for a 16-bit unsigned, use00000. - Field type: leave as Input / Output to permit operator entry.
- Update: keep the default (every 250 ms while in focus / on each Acquire cycle).
Click OK to apply. Save the picture. With the WinCC project running, the I/O field displays the current value of the S7-300 tag, and an operator can type a new value and press Enter (or Tab) to write it back to the PLC. The PLC program reads the new value on the next OB1 cycle.
5. Common S7-300 Part Numbers and Constraints
Use this reference table when sizing the S7-300 side of the link. The CP module determines which sub-channel you select in the SIMATIC S7 Protocol Suite.
| Module | Order number (MLFB) | Interface | Use with WinCC channel |
|---|---|---|---|
| CPU 314 (basic) | 6ES7314-1AG14-0AB0 | MPI | MPI |
| CPU 315-2 PN/DP | 6ES7315-2EH14-0AB0 | MPI/DP + PROFINET | MPI / Industrial Ethernet |
| CPU 317-2 PN/DP | 6ES7317-2EK14-0AB0 | MPI/DP + PROFINET | MPI / Industrial Ethernet |
| CPU 319-3 PN/DP | 6ES7319-3EP10-0AB0 | MPI/DP + 2× PROFINET | Industrial Ethernet (PROFINET interface as Ethernet) |
| CP 343-1 Lean | 6GK7343-1CX10-0XE0 | Ethernet | Industrial Ethernet (ISO-on-TCP) |
| CP 343-1 | 6GK7343-1EX30-0XE0 | Ethernet | Industrial Ethernet (ISO-on-TCP / TCP) |
| CP 342-5 | 6GK7342-5DA02-0XE0 | PROFIBUS DP master/slave | PROFIBUS |
| CP 343-1 Advanced (S7-300) | 6GK7343-1GX31-0XE0 | Ethernet + Security | Industrial Ethernet (secure communication) |
Note: S7-300 was phased out of general sale by Siemens. Firmware support and spare parts are maintained in the corresponding SIMATIC product phase-out schedule. For new installations, evaluate S7-1500 + TIA Portal + WinCC Professional / Unified. The WinCC V7.x line continues to receive maintenance for S7-300/400 integration.
6. Tag Addressing and Data Type Mapping
Choosing the correct data type is essential. The WinCC tag type must match the STEP 7 declaration exactly, or sign-extension and range mismatches will surface as soon as a negative number or a value above 32767 is written.
| STEP 7 data type | WinCC data type | Address example | Range / notes |
|---|---|---|---|
| BOOL | Binary Tag | DB10.DBX0.0 |
0 or 1 |
| BYTE | Unsigned 8-bit | DB10.DBB0 |
0…255 |
| WORD | Unsigned 16-bit | DB10.DBW0 |
0…65535 |
| INT | Signed 16-bit | DB10.DBW0 |
-32768…32767 |
| DWORD | Unsigned 32-bit | DB10.DBD0 |
0…4294967295 |
| DINT | Signed 32-bit | DB10.DBD0 |
-2^31…(2^31 - 1) |
| REAL | Float 32-bit IEEE 754 | DB10.DBD0 |
Matches STEP 7 REAL exactly |
| CHAR | Text Tag, 8-bit char | DB10.DBB0 |
Single ASCII character |
| STRING | Text Tag, 16-bit char |
DB10.DBB0 (max len header) |
Set length in STEP 7 (e.g. STRING[20]) |
7. Step-by-Step Recap
- Verify the WinCC PC can reach the S7-300 CP:
ping 192.168.0.10for Ethernet, or use STEP 7 "Accessible Nodes" for MPI/PROFIBUS. - Open WinCC Explorer → Tag Management → add the SIMATIC S7 Protocol Suite driver.
- Create a new connection in the correct sub-channel; set IP / MPI / PROFIBUS address, rack = 0, slot = 2.
- Right-click the connection → New Tag → set name, data type, address, and update cycle.
- Open Graphics Designer → drag an I/O field → bind it to the tag → set the input/output format.
- Save the project. Activate Runtime.
- In Runtime, type the new value (e.g.,
250) into the I/O field, press Enter. The S7-300 receives the new value; cross-check in STEP 7 with a VAT table or PLCSIM monitor.
8. Verification and Diagnostics
8.1 Connection status
- In WinCC Explorer, expand the connection. If the connection is healthy, the red dot becomes a small green or yellow icon. A persistent red dot indicates that the SIMATIC S7 Protocol Suite cannot establish a connection with the configured CP.
- Open the Channel Diagnosis tool (Start → SIMATIC → WinCC → Channel Diagnosis) to see real-time diagnostic counters (send/receive errors, timeouts, connection attempts).
8.2 Tag quality
- On a screen, configure an output field bound to the same tag. A quality code of
0xC0(bad) signals a connection or address error;0x00(good) is normal. - Force a read/write by toggling a test tag in the I/O field and confirming with STEP 7 online monitor (VAT table) or PLCSIM.
8.3 PLC-side check
- In STEP 7, open the relevant DB and check the value. If the value does not change after a WinCC write, the issue is on the HMI side (no write permission, wrong data type, or the address points to an M area that is overwritten by the S7 program in OB1).
- Monitor the S7-300 diagnostic buffer (online → PLC → Diagnostic Buffer) for "communication error" entries that indicate a malformed telegram.
9. Troubleshooting Matrix
| Symptom | Likely cause | Remedy |
|---|---|---|
| Red dot on connection; tag quality bad | Wrong IP / MPI / PROFIBUS address, or S7-300 CP not reachable | Ping the CP; check firewall on WinCC PC; verify rack/slot |
| Value written in WinCC reverts immediately | S7 program overwrites the same address every OB1 cycle | Move the value to a non-cyclic DB or use a SET / RESET pattern from HMI |
| I/O field accepts only the original value range | Wrong data type (e.g. 16-bit signed for a 32-bit value) | Change WinCC tag type to match the STEP 7 declaration |
| Cannot save project changes | Only an RT license is installed | Install an RC (Development) license; the RC license unlocks engineering functions |
| WinCC 7.0 can read but not write | Write attribute is disabled on the tag | Open tag properties → ensure Read/Write is selected (not Read only) |
| Operator value is accepted in I/O field but not visible in STEP 7 | Tag points to a process image area that is not refreshed | Re-check that the address is in M or DB area, not I (inputs are read-only from HMI perspective) |
| Random or fixed value of 0 | Wrong byte/word/double-word alignment | Use only even offsets for word (MW) and only even or properly aligned offsets for double-words (MD); use DBB for byte access |
| CPU SF LED on, OB121 priority class error | Access to a non-existent DB or wrong DB number | Verify the DB number; ensure the DB has been downloaded to the CPU; check DB length vs. address offset |
10. Practical Tips and Field Caveats
- Use a Data Block, not M area, for setpoints: Bit memory (M) is volatile and the S7 program may reinitialize it on restart, mode change, or warm restart. A DB with a defined initial value gives predictable behavior. Mark the DB as "non-optimized" / "standard access" so that absolute addressing from WinCC is possible.
- Avoid writing directly to I and Q: Inputs and outputs are tied to the I/O process image; writing to them from HMI is either impossible or causes unintended side effects.
- Byte order for S7-300: S7-300 (and S7-400) are big-endian (Motorola byte order). The SIMATIC S7 Protocol Suite handles this automatically; mismatches in custom third-party tools are a common source of confusion.
- Update cycle: For a setpoint, 500 ms to 1 s is usually sufficient. Driving the cycle below 250 ms loads the S7 connection unnecessarily and can starve other HMI tags of the same channel.
- PLCSIM for testing: S7-PLCSIM allows tag writes from WinCC to be exercised without a physical S7-300. Set the connection's IP to the PLCSIM instance and use the same S7 Protocol Suite channel.
- Multiple HMI clients: Multiple WinCC stations writing the same tag is permitted; the last writer wins. For arbitration, use handshake bits (e.g., a "write-in-progress" BOOL cleared by the PLC after a successful transfer).
- Security for newer controllers: The S7-1200 / S7-1500 / S7-1500T controllers use certificate-based authentication for secure HMI communication. If migrating the pattern to those controllers, import the HMI certificate into the CPU's global certificate manager, and the CPU certificate into the HMI/engineering station. Refer to the TIA Portal documentation: Importing and Exporting Certificates (S7-1200/S7-1500/S7-1500T).
11. Performance and Sizing Notes
The SIMATIC S7 Protocol Suite supports up to 32 connections per channel instance, with up to 8,000 tags per project (license-dependent) and a maximum recommended update rate of 100 ms for high-priority data. For a single HMI station monitoring one S7-300 with fewer than 1,000 tags, a 1-second cycle is the standard baseline.
Estimated network load per tag per cycle (at 1 s): roughly 20–40 bytes per read, plus write traffic. With 500 tags at 1 s, expect 10–20 kbit/s sustained on an Ethernet segment — well below 100 Mbit/s, but still relevant for shared subnets.
12. Frequently Asked Questions
Which WinCC channel should I use to connect to a SIMATIC S7-300 over Ethernet?
Use the SIMATIC S7 Protocol Suite → Industrial Ethernet sub-channel. Create a new connection, set the IP address of the CP 343-1 (for example, 192.168.0.10), rack 0, slot 2, and connection type ISO-on-TCP. This is the default for S7-300 with a CP 343-1 Lean / CP 343-1 or any onboard PROFINET port used as Ethernet.
Can I write to MD 100 from an I/O field in WinCC 7.0?
Yes. Create a WinCC tag with the address MD 100 and data type Signed 32-bit (or Float 32-bit IEEE 754 for a REAL). Bind an I/O field on a Graphics Designer picture to that tag, and the operator can type a new 32-bit value and press Enter to write it to MD 100 in the S7-300.
Why can I read MD 100 from WinCC but cannot write to it?
Three common causes: (1) the tag's access attribute is set to Read only instead of Read/Write; (2) the S7-300 program overwrites MD 100 in OB1 every cycle, masking the HMI write; (3) MD 100 lies in a non-standard area (for example, a write-protected system area). Switch the tag to Read/Write, move the setpoint to a DB that is only written by the PLC logic, and re-test.
Do I need an RC license to change a value at runtime?
No — the RC (Development) license is required to modify the project (add tags, change screens, save the project). At runtime, any operator with appropriate user authorization can change the value via the I/O field on the screen.
Is the procedure different for S7-1200 / S7-1500 / S7-1500T?
Yes, for new projects the recommended path is TIA Portal with WinCC Professional or WinCC Unified. The S7-1200 / S7-1500 / S7-1500T controllers require "standard" (non-optimized) DBs for HMI access via absolute addresses, and secure communication uses certificates. For certificate import/export on these controllers, see the official TIA Portal V20 documentation: Importing and Exporting Certificates (S7-1200/S7-1500/S7-1500T).