Configuring WinCC Modbus TCP for Twido PLC Input Reading
This field-proven reference bridges a Schneider Electric Twido controller to Siemens WinCC V7 and WinCC Unified over Modbus TCP/IP. It documents the Ethernet expansion module commissioning, the Twido Modbus server parameters, the Modicon-style address mapping for %I, %Q, %M and %MW objects, and the driver / tag settings in both the WinCC classic explorer and the TIA Portal Unified project tree. Each section ends with a verification step so a commissioning engineer can confirm the link before looping the rest of the plant into the HMI.
1. Integration Overview
Twido controllers expose their I/O and memory map through Modbus TCP when equipped with the Twido Ethernet expansion module (Modular bases) or the integrated Ethernet port found on certain Compact bases. By configuring WinCC as a Modbus TCP client, the HMI can poll discrete inputs (%I), output coils (%Q), internal memory bits (%M), and 16-bit memory words (%MW) without any custom OPC bridging layer. The protocol is plain Modbus TCP/IP: TCP transport, server port 502, deterministic request/response, well suited to HMI refresh intervals of 250 ms to 1 s.
The WinCC side can use one of two platforms: WinCC V7.x (Classic) with the "SIMATIC WinCC Modbus TCP/IP" driver option, or WinCC Unified inside TIA Portal (Comfort Panels, Unified Comfort Panels, or Unified PC). Both platforms speak identical wire-level Modbus TCP; they differ in project-tree structure, tag editor layout, and how events are wired to scripts.
Typical network topology
2. Prerequisites
| Item | Spec / Version | Purpose |
|---|---|---|
| Schneider Twido controller | Modular (TWDLMDA*) or Compact (TWDLCAA*) base, equipped with the Twido Ethernet option module or using the integrated Ethernet port | Modbus TCP server |
| TwidoSuite programming tool | TwidoSuite v2.31 or later; firmware 5.0 or higher recommended | Configure IP, protocol, unit ID |
| Siemens WinCC | WinCC V7.5 SP2 or higher with the "SIMATIC WinCC Modbus TCP/IP" driver option; alternatively TIA Portal V17 / V18 / V19 / V20 with WinCC Unified or Comfort View | HMI / SCADA client |
| Ethernet infrastructure | 100 BASE-TX; managed or unmanaged switch acceptable | Connect WinCC engineering station to Twido |
| IP plan | Twido: 192.168.10.50 / 24; Engineering station: 192.168.10.10 / 24; no router required for same subnet | L3 reachability |
| Twido application program | Defines the %I, %Q, %M, %MW objects required by the HMI screens | Data exposure |
3. Twido Ethernet Module Commissioning
The Twido Ethernet module drops into the right-side expansion slot of a Modular Twido base. The panel provides two RJ45 sockets that act as an unmanaged internal switch, so a daisy-chain topology is possible without external switching hardware.
- Open TwidoSuite and load the active Twido project.
- Connect to the controller (USB / Serial / Ethernet if reachable).
- Open Hardware configuration and confirm the Ethernet option module is detected. Note its slot index; the slot order determines how TwidoSuite references the module in the network configuration dialog.
- Open the Ethernet dialog of the module and configure:
- IP address:
192.168.10.50 - Subnet mask:
255.255.255.0 - Gateway:
0.0.0.0unless inter-VLAN routing is required - Ethernet Mode:
100BaseTX, auto-negotiate - Transmission:
Auto
- IP address:
- Download the configuration to the controller. A cold restart is required for the IP to take effect on certain firmware revisions.
- Ping the controller from the WinCC engineering station. A ping failure indicates either physical link, subnet, or Windows Defender Firewall; verify link LEDs (green steady = 100 Mbit/s link), subnet mask, and firewall rules.
4. Twido Modbus TCP Server Configuration
Twido firmware ships the controller's internal data map over the standard Modbus TCP port 502. The Modbus function codes supported by a Twido are listed below.
| Function Code | Name | Twido Object | Bit / Word |
|---|---|---|---|
| 01 (0x01) | Read Coils | %Q, %M | Bit |
| 02 (0x02) | Read Discrete Inputs | %I | Bit |
| 03 (0x03) | Read Holding Registers | %MW | 16-bit Word |
| 04 (0x04) | Read Input Registers | Analog %IW (where supported by the model) | 16-bit Word |
| 05 (0x05) | Write Single Coil | %Q, %M | Bit |
| 06 (0x06) | Write Single Register | %MW | 16-bit Word |
| 15 (0x0F) | Write Multiple Coils | %Q, %M | Bits |
| 16 (0x10) | Write Multiple Registers | %MW | Words |
- In TwidoSuite, expand the Ethernet option module under the controller and double-click TCP/IP Protocols.
- Tick Modbus TCP Server. The default listener is TCP port
502. Edit only if a port collision is known (for example, a SCADA gateway already occupying 502). - Configure the connection inactivity timeout: 30 seconds is a safe default that lets the WinCC client detect a lost connection faster than the OS-level TCP keepalive.
- If the Twido sits behind a NAT router, forward TCP 502 to the controller IP. The WinCC-side address becomes the NAT public IP and the Unit Identifier (also called the Modbus slave address) stays at the Twido's local ID (default 1, or 255 to ignore it).
- Save and download to the controller. Confirm the server is listening with a portable Modbus TCP client (see §9).
0x01 = illegal function (wrong FC for the area), 0x02 = illegal data address (offset out of range), 0x03 = illegal value (count exceeds the address space). Always cross-check the requested object against the Twido memory map printed by TwidoSuite → File → Report → Memory map.5. Modbus Address Mapping Reference
Twido follows the Modicon addressing convention. The reference number is the Modbus 0-based offset plus a leading area digit; the table below summarizes the relationship between Twido objects and Modbus reference numbers.
| Twido Object | Modbus Reference | Function Code | Width | Read / Write |
|---|---|---|---|---|
| %I0..%In (discrete inputs) | 1xxxxx (one-based) | 02 | Bit (request up to 16 per transaction to optimize) | Read-only |
| %Q0..%Qn (outputs / coils) | 0xxxxx | 01 / 05 / 15 | Bit | Read / Write |
| %M0..%Mn (internal bits) | Model-dependent; TwidoSuite reports the base | 01 / 05 / 15 | Bit | Read / Write |
| %MW0..%MWn (memory words) | 4xxxxx | 03 / 06 / 16 | 16-bit Word (sign-aware) | Read / Write |
| %IW (analog inputs) | 3xxxxx | 04 | 16-bit Word | Read-only |
| %QW (analog outputs) | 4xxxxx | 03 / 06 / 16 | 16-bit Word | Read / Write |
Example for a TWDLMDA40DRF with default memory layout. The exact base addresses vary by Twido firmware revision and physical I/O count; always export TwidoSuite's addressing report into the WinCC project so the offsets match.
| Twido Object | Modbus Reference (typical) | Function Code | Notes |
|---|---|---|---|
| %MW100 | 40101 | 03 | Example holding register |
| %MW200 | 40201 | 03 | Counter example |
| %I0 (first discrete input) | 10001 | 02 | Read-only |
| %Q0 | 00001 | 01 / 05 | Output coil |
| %M0 | 28001 or 30001 (model dependent) | 01 / 05 | Memory bit area |
| %IW0 (analog input 0) | 30001 | 04 | Analog input register |
Conversion formulas
When the Twido stores values that WinCC must display with engineering units, the conversions use the standard Modbus driver scaling. For a signed 16-bit value raw coming back from %MW (Function 03), the WinCC tag should be configured with Signed 16-bit data type so the driver already produces the two's-complement signed value; the formula for displaying raw / full-scale 0–2000 counts as °C is:
Temp (°C) = (raw - offset) × span / 32768
For a Float32 spanning %MW400..%MW401 with a 0.1 engineering scaling (raw 0..10000):
Display = Real_tag_value × 0.1
For a Boolean input sent as a single bit in %MW500 (least significant bit), set the WinCC bit offset to 15 - bit_index or use the dedicated bit-access primitive exposed by the driver.
6. WinCC V7 Classic Configuration
WinCC V7 (from V7.4 onward) provides the "SIMATIC WinCC Modbus TCP/IP" driver. The configuration is performed in WinCC Explorer.
- Open WinCC Explorer and select the project.
- Right-click Tag Management → Add New Driver. Choose ModbusTCP from the catalog under "SIMATIC NET/TCP/IP" drivers.
- Right-click the new driver → New Connection:
- Name: e.g.,
TWD_TWDLMDA40 - Type: TCP/IP
- Device address:
192.168.10.50 - Port:
502 - Unit Identifier / Slave ID:
1; use255if the Twido sits behind a NAT or when the Unit ID is not enforced. - Connection timeout:
5000ms - Cycle time:
1000ms (lower for tight updates)
- Name: e.g.,
- Click the new connection and define tags. The WinCC V7 tag dialog accepts:
- Data Type: Binary, Unsigned 16-bit, Signed 16-bit, Float 32, etc.
- Direction: Input (read) or Output (write)
- PLC name: e.g.,
Twido(within connection tree) - Address (0-based offset within the area): type the requested Twido address as decimal offset.
Example tag definitions
| WinCC Tag | Data Type | Address Offset | Twido Object | FC used | Direction |
|---|---|---|---|---|---|
| DI0 | Binary | 0 | %I0 | 02 | Input |
| DI15 | Binary | 15 | %I15 | 02 | Input |
| DO0_OUT | Binary | 0 | %Q0 | 01 / 05 | Output |
| COUNTER_VALUE | Unsigned 16 | 200 | %MW200 | 03 / 06 | Output (read/write) |
| TEMP_PV | Signed 16 | 300 | %MW300 | 03 | Input |
| PRESS_F | Float 32 (Motorola) | 400 (two words) | %MW400..%MW401 | 03 (multi-word) | Input |
For float-32 values the driver reads two consecutive holding registers; ensure the Byte Order matches the Twido's word sequence to avoid a value such as 1.18E-19 in place of 23.5.
Verification in WinCC V7
- Activate the project. The tag icon shows green for a healthy connection; yellow or red indicates an error code.
- Open Tag Management → Tags → <tag> and click Status to read the driver-internal quality code.
- Use Tools → Channel Diagnostics to inspect the Modbus transaction count, RTT, and exception rate.
7. WinCC Unified (TIA Portal V17 / V18 / V19 / V20) Configuration
WinCC Unified combines Comfort Panel RT, Unified Comfort Panel RT, and Unified PC under one project model inside TIA Portal. The Modbus TCP driver is a built-in HMI driver.
- Add a new HMI device in the project. For Comfort Panels use "Comfort Panel"; for unified panels use "Unified Comfort Panel"; for PC runtime use "WinCC Unified PC" (RT).
- Open Devices & Networks → <HMI> → Connections. Add a new connection of type Modbus TCP.
- Set the connection attributes:
- Local endpoint: the HMI device's IP (e.g., 192.168.10.10)
- Partner endpoint: 192.168.10.50, port 502, role Server (Twido is the Modbus server)
- Mode: TCP direct
- Unit ID:
1or255per requirement - Acquisition cycle:
250ms for fast inputs;1000ms for status words
- Open the HMI tag editor and add tags under the connection. Each tag specifies:
- Name: e.g.,
Twido_DI00 - Connection: the Modbus TCP connection created above
- Data type: Bool, Int, Word, Real, etc.
- Address: Modicon notation (e.g.,
100001for the first discrete input) - Access mode: Read-only or Read / Write
- Acquisition: Cyclic in operation for typical HMI updates; Cyclic continuous for background logging
- Name: e.g.,
- Compile the HMI and download to the runtime. Confirm connection status via Runtime → Diagnostics → Connections.
WinCC Unified address syntax
| HMI Tag | Address (Modicon notation) | Data Type | Twido Source | FC Issued |
|---|---|---|---|---|
| Twido_DI00 | 100001 | Bool | %I0 | 02 |
| Twido_DO00 | 000001 | Bool | %Q0 | 01 / 05 |
| Twido_COUNTER | 400201 | Word | %MW200 | 03 |
| Twido_TEMP_PV | 400301 | Int | %MW300 | 03 |
| Twido_PRESS_F | 400401 (length=2 words) | Real (32-bit) | %MW400..%MW401 | 03 (multi-word) |
Bit extraction from a Word
If the Twido packs 16 discrete inputs into a single %MW (for example, a remote I/O scanner that returns module-2 inputs in %MW50), expose that word as a 16-Bit Unsigned and decode in the HMI logic:
Bool_Twido_DI_3_07 = (Twido_DI_PACK0 AND 0x0080) >> 7
8. Reading and Reacting to Input Events
After the inputs are polled into WinCC Unified, two workflows commonly arise: triggering scripts on input changes and committing entered values back to the Twido.
- Place an IO field, slider, or toggle button on the screen.
- Open the Properties pane and expand Events.
- The event "Input finished" (sometimes labeled "Value input finished") exposes an event to set a tag, change the active screen, or invoke a VB / C script.
- To trigger a write back to a Twido setpoint, wire the IO field's "Value input finished" event to a SetTag / script that updates the writable %MW tag.
The official WinCC Unified runtime documentation describes the input life cycle of an IO field, including the numeric pad, as part of the function-list Input support (RT) section. See WinCC Unified input support (RT) for the canonical event names and runtime function signatures for V20; equivalent behavior exists in V17, V18, and V19 with the same event labels.
Tag change events
For raw input bit changes delivered by the Twido (e.g., a high-speed discrete input wired into %I2), configure a Value change trigger on the corresponding HMI tag. The handler runs in the Unified runtime's VBScript / C engine and can write to other tags, log to SQL, or trigger an alarm.
Modbus TCP transaction timing
9. Verification and Online Diagnostics
After the driver and tag settings are downloaded, run the following ladder before sign-off.
-
Physical layer:
ping 192.168.10.50from the engineering station. <5 ms RTT on a switch network is healthy; >50 ms suggests cabling or duplex mismatch. - Modbus TCP open: Use a portable client (qModMaster, Modbus Poll, or a custom Wireshark trace using the "mbtcp" decoder) to confirm port 502 answers and that holding register 100 holds the value programmed in TwidoSuite.
- WinCC tag status: In WinCC V7 right-click the tag → Status, ensure Quality Code = "Good". In WinCC Unified inspect the tag's Quality column in the tag editor or the runtime diagnostics view.
- Live update: Configure a screen containing an IO field bound to the tag. Toggle the input on the Twido base (or edit the value in an animation table in TwidoSuite) and confirm the IO field refreshes within the configured polling cycle.
- Forced failure: Power the Twido to OFF. Within the connection timeout the tag should display "Communication Fault" / "No Connection". This validates the failure path before plant tie-in.
- Input finished event: Trigger the HMI "Input finished" event by entering a value in a numeric IO field. Verify the configured handler executes (for example, a confirmation banner appears briefly).
Wireshark capture recipe
- Run Wireshark on the engineering station with capture filter
tcp port 502. - Apply display filter
mbtcpto show only Modbus / TCP frames. - Confirm each request has a matching response with the same Transaction ID, normally < 50 ms apart.
- Watch for TCP retransmissions; these indicate duplex mismatch or unstable cabling.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Investigation | Corrective Action |
|---|---|---|---|
| Connection icon red in driver tree | Twido IP unreachable, wrong subnet, or firewall | Ping; arp -a; WinCC Event Log; Wireshark (no SYN) |
Re-check IP plan; disable Windows firewall rule or open inbound TCP/502 |
| Good TCP connect, replies "Illegal Data Address" (Exception 02) | Request outside the Twido's memory map (e.g., %MW880 on a 256-word model) | TwidoSuite → Memory map report | Reduce the requested offset or move to a model with more memory |
| All reads return zero even though Twido is alive | Wrong FC selected (FC03 vs FC04) or wrong Unit ID | Modbus Poll FC03 against 40101 | Correct FC in the tag; set Unit ID = 1 unless NAT demands 255 |
| Floating point values garbage | Byte order mismatch (Motorola vs Intel) | Set 23.5 in %MW400..%MW401 and read externally | Swap word order or set WinCC tag byte order to "Intel / Little-endian" |
| Reads OK but writes fail | Read-only memory (%I, %IW) or inconsistent Unit ID | Reference Twido Modbus guide for writability | Switch tag direction to "Read/Write"; bind to %Q or %MW |
| HMI sees correct values but screens lag | Long acquisition cycle or many small polls | WinCC channel diagnostics showing RTT | Group consecutive addresses into one block; lower cycle to 250–500 ms |
| "Input finished" event missing on a numeric IO field | Field set to Output-only mode (TIA V17 known UI quirk) | Switch field Mode; verify RT version | Upgrade TIA project to V18 or V20; change Mode to Output/Input |
| Tag oscillates between OK and Bad | Poll rate faster than Twido can answer; duplex mismatch | Wireshark: duplicate MBAP requests or TCP retransmissions | Increase cycle to ≥ 100 ms; pin Ethernet switch to 100/Full |
| Connection drops under heavy load | TCP keepalive idling the socket | Check Twido Ethernet module's Connection Timeout | Increase Connection Timeout to 60 s; enable WinCC "Maintain permanent connection" |
| Multiple Twido slaves on one WinCC connection | Connection configured but only one Unit ID present | Tag list shows only one device | Add one separate connection per Twido Unit ID (slave) and address tags per device |
| WinCC Classic accepts tag, but runtime says "No such driver" | ModbusTCP driver license not activated | License / Authorization Log | Install and license the Simatic Net Modbus TCP option |
11. Frequently Asked Questions
What is the default Modbus TCP port on a Twido controller?
The default port is 502, configurable inside TwidoSuite under the Ethernet option's TCP/IP Protocols dialog. Change it only when a SCADA gateway already occupies 502.
How do I read Schneider Twido digital inputs in WinCC?
Expose the %I as Modbus Discrete Inputs (Function Code 02) on addresses 1xxxxx. In WinCC V7 select Binary Tag with offset 0 for %I0; in WinCC Unified use the address 100001 with Bool data type. Verification: toggle the input on the Twido base and watch the IO field update within the polling cycle.
Why does my WinCC Unified IO field not show the "Input finished" event in TIA Portal V17?
Switch the field's Mode from "Output only" to "Output / Input". In TIA Portal V17 the event is hidden when the field has no input path. Upgrading the project to V18 or V20 re-exposes the event without a Mode change.
How do I convert 32-bit floats from Twido memory words in WinCC?
Twido stores floats low-word-first (little-endian). Configure the WinCC tag as Float 32 with byte order "Intel / Little-endian" or "Motorola / Big-endian" depending on firmware; verify by writing 23.5 (0x41BC0000) into %MW400..%MW401 from TwidoSuite and reading back at the HMI.
Can one WinCC connection serve multiple Twido slaves?
No. Each Twido slave requires its own Modbus TCP connection in WinCC (one Unit ID per connection). Add multiple connections in Tag Management and assign each device's tags to the matching connection.
What WinCC version supports TIA Portal V20 and Modbus TCP over Twido?
WinCC Unified inside TIA Portal V17, V18, V19, and V20 all support the Modbus TCP driver. Use the most recent runtime you are entitled to so the Input support event set in the function list matches the version of your faceplates.
Which Twido memory objects are writable from WinCC?
%Q (output coils), %M (memory bits), %MW (memory words), and %QW (analog outputs) are writable via Function Codes 05 / 06 / 15 / 16. %I and %IW are read-only; any write attempt returns an Illegal Function exception.