Configuring WinCC Modbus TCP for Twido PLC Input Reading

David Krause16 min read
HMI / SCADASiemensTutorial / 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

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.

Note: The Twido Modbus TCP server answers one transaction per request at ~5–20 ms RTT. Avoid sub-50 ms polls for large tag sets. Group consecutive %MW and %I addresses into one request by widening the address window in the WinCC tag.

Typical network topology

WinCC Engineering 192.168.10.10 Ethernet Switch 100 BASE-TX Twido + Ethernet module 192.168.10.50 :502 TCP 502 Modbus TCP

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
Reference: WinCC Unified runtime behavior for input fields, including num pad and slider handling, is documented in WinCC Unified input support (RT).

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.

  1. Open TwidoSuite and load the active Twido project.
  2. Connect to the controller (USB / Serial / Ethernet if reachable).
  3. 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.
  4. 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.0 unless inter-VLAN routing is required
    • Ethernet Mode: 100BaseTX, auto-negotiate
    • Transmission: Auto
  5. Download the configuration to the controller. A cold restart is required for the IP to take effect on certain firmware revisions.
  6. 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.
Cold restart caveat: Some Twido firmware revisions only commit a new IP after a stop / run transition. Schedule a brief controller stop on the maintenance window before commissioning starts.

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
  1. In TwidoSuite, expand the Ethernet option module under the controller and double-click TCP/IP Protocols.
  2. 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).
  3. 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.
  4. 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).
  5. Save and download to the controller. Confirm the server is listening with a portable Modbus TCP client (see §9).
Exception codes: When a request targets a data area that does not physically exist, Twido replies with Modbus exception codes. 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
Endian math: Twido memory words are 16-bit little-endian; a 32-bit IEEE-754 float stored in %MW400..%MW401 occupies the low word first. If WinCC presents a Real in big-endian, swap the word order (or set the tag's byte order to "Little-endian / Intel") to read 23.5 as 23.5 rather than 1.38E-19.

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.

  1. Open WinCC Explorer and select the project.
  2. Right-click Tag ManagementAdd New Driver. Choose ModbusTCP from the catalog under "SIMATIC NET/TCP/IP" drivers.
  3. 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; use 255 if the Twido sits behind a NAT or when the Unit ID is not enforced.
    • Connection timeout: 5000 ms
    • Cycle time: 1000 ms (lower for tight updates)
  4. 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.

  1. 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).
  2. Open Devices & Networks → <HMI> → Connections. Add a new connection of type Modbus TCP.
  3. 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: 1 or 255 per requirement
    • Acquisition cycle: 250 ms for fast inputs; 1000 ms for status words
  4. 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., 100001 for the first discrete input)
    • Access mode: Read-only or Read / Write
    • Acquisition: Cyclic in operation for typical HMI updates; Cyclic continuous for background logging
  5. 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)
Address format: WinCC Unified's Modbus TCP driver expects a six-digit reference number. The leading digit identifies the area (0=coils, 1=discrete inputs, 3=input registers, 4=holding registers). The next five digits are the 0-based offset. For Bool area tags (0xxxx and 1xxxx) the driver returns one bit; for word area tags the driver returns one 16-bit 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.

  1. Place an IO field, slider, or toggle button on the screen.
  2. Open the Properties pane and expand Events.
  3. 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.
  4. 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.

Visibility tip: In TIA Portal V17 the "Input finished" event sometimes disappears when the IO field's Mode is set to Output only; switch Mode to Output / Input to expose the event. This is a known UI quirk rather than a runtime limitation.

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

HMIPLC Read Holding 03/100 (req) Tx ID 1 + 4 bytes PDU Response (FC 03 + value) Read Input 02/0 (req) Tx ID 2 + bytes Twido single transaction 5–20 ms RTT. HMI cycle = sum of (request + response + gap).

9. Verification and Online Diagnostics

After the driver and tag settings are downloaded, run the following ladder before sign-off.

  1. Physical layer: ping 192.168.10.50 from the engineering station. <5 ms RTT on a switch network is healthy; >50 ms suggests cabling or duplex mismatch.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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

  1. Run Wireshark on the engineering station with capture filter tcp port 502.
  2. Apply display filter mbtcp to show only Modbus / TCP frames.
  3. Confirm each request has a matching response with the same Transaction ID, normally < 50 ms apart.
  4. 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.

Back to blog