Troubleshooting
Connect an S7-1500 or S7-1200 to Wonderware over Modbus TCP
Short answer
Yes - connect either CPU to Wonderware over Modbus TCP. Call MB_SERVER unconditionally from a cyclic OB, point its register area at a non-optimized global DB, and define the CPU as a Modbus TCP device in the Wonderware I/O server; ping, a port connect test, the STATUS word and a known-constant register read then isolate where the link breaks.
On this page
Yes, an S7-1500 or an S7-1200 connects to Wonderware, and the SCADA link should not decide your S7-300-versus-S7-1500 choice, because it works the same from either side. Connect them over Modbus TCP: call MB_SERVER unconditionally from a cyclic OB on the CPU, point its register-area input at a global data block with optimized block access switched off, and define the CPU in the Wonderware I/O server as a plain Modbus TCP device that reads holding registers with Modbus function 3 on TCP port 502. InTouch then sees ordinary Modbus data, with no Siemens-specific driver involved on the SCADA node. When the link comes up dead or values look wrong, run the checks below in order: ping, a connect test on the Modbus port, the STATUS word, then a known constant read back through the register map.
Check that the DASServer speaks Modbus TCP #
InTouch never talks Modbus itself; the I/O server layer does that job — the DASServer. So the first question is whether the Modbus TCP DASServer is installed on the SCADA node and set up for the device count you need. Check which product the label V11 actually names in your plant, because that version number has covered more than one Wonderware product line, and read the installed I/O server's release notes for the protocols it serves. A Modbus-capable DASServer present: go straight to the CPU side. One missing: that is the whole fault, and no PLC setting repairs it — install the server from the manufacturer's official distribution channel before you configure anything else.
Bring up MB_SERVER on the CPU #
MB_SERVER is the documented server instruction for both CPU families; the manufacturer's Modbus TCP application note covers the S7-1500 and the S7-1200 with the same call pattern. Set the call up in this order:
- Create one global data block for the exchange area and switch off optimized block access, so the server can address the block as registers. My worked example below names it
DB_ModbusExchand declaresawData : Array[0..99] of Wordin it. - Call
MB_SERVERunconditionally from a cyclic OB — plainOB1for a first bring-up — never behind a jump or a condition that can skip the call on some scans. If the program also runs periodic logic in a cyclic interrupt OB, note that its timers do not behave like OB1's: timer behavior in OB1 and OB35 cyclic interrupts explains the difference. - Keep
DISCONNECTat FALSE; a TRUE there closes the passive connection. - Point
CONNECTat the connection descriptor with the listening port set to 502 and the remote partner left at 0, which makes the instruction accept connection requests from any device that dials in. - Give every server instance in the CPU its own connection ID. A duplicate ID is the usual reason a second client is refused while the first one works.
- Watch
STATUSin a watch table while you test: withERRORat FALSE the instance is serving, and a fault code that appears only while InTouch polls points at the request the server rejects. The TIA Portal help entry for the instruction decodes each value.
The full PLC-side setup, block by block, is walked through in Connect an S7-1500 to Modbus TCP in TIA Portal.
Run four checks in order #
Work from the machine that runs the DASServer for the first two; the last two span both sides. Stop at the first layer that fails:
- Ping the CPU. No reply means IP address, subnet mask, VLAN, cabling or a firewall between the two nodes — fix that layer before you touch any Modbus setting. A reply proves reachability only; a ping that succeeds while the device stays invisible is its own failure mode, and Why ping succeeds but the PROFINET device is not found walks through it.
- Test the Modbus port. Open a TCP connection to the CPU on port 502 with any test tool approved for the plant network. Refused: no listener — the CPU is in STOP or the server call is being skipped on some scans. Timed out: firewall or routing blocks the port between those two nodes. Connected: transport is good, move to addressing.
- Read
STATUSduring the first polls. WithERRORat FALSE the instance serves every request it accepts; a fault code that shows up while InTouch polls but not while the link idles belongs to the request, not to the wiring. - Read a known constant. Write the test constant into the first holding-register word of the exchange block and read that single item in InTouch. The worked example below carries the full arithmetic.
You can rehearse checks 2 to 4 on one PC before anyone opens a cabinet: How to simulate a Modbus TCP SCADA link on one PC.
Worked example: DB word 0 read as InTouch item 40001 #
Inputs, all example values for this case: the exchange block DB_ModbusExch (my example name) with optimized block access off and awData : Array[0..99] of Word initialised to zero; the CPU at IP address 192.168.1.50, given here as an example address; a DASServer device definition pointing at that address on the Modbus port; and one InTouch item that reads holding register 40001 with Modbus function 3. The PLC program has written the test value 1234 into awData[0].
The rule in words: MB_SERVER serves its register area beginning at Modbus protocol address 0, and a 40001-style reference is one-based, so protocol address = reference - 40001.
The arithmetic: 40001 - 40001 = 0, so the item lands on the first word, awData[0]. On the wire, 1234 decimal = 4 × 256 + 210, so the register carries the two bytes 16#04 and 16#D2.
Result: the InTouch item shows 1234, and the map is aligned.
The decision: if the item reads 1234, add the remaining points one at a time, changing one thing per test. If it reads a neighbouring word's value instead, the client base is off by one — flip the zero-based or one-based setting in the DASServer item definition and retest. If it reads zero or answers with an exception, the register type or the map itself is wrong, which the next section sorts out.
Match the register map when values come back wrong #
Three faults survive a clean port test:
- Off by one. The worked example pins the rule: a 40001-style reference sits at protocol address reference - 40001, so a client configured zero-based shifts every value one word.
- Wrong register type. The server area is exposed as holding registers, which Modbus function 3 reads. An item defined as a coil or an input register answers with an exception or returns unrelated data.
- Word order. Modbus registers are 16 bits, so a REAL or DInt spans two words and both word orders exist in the field. Integers arriving right while floats come back as garbage means the client's word-order setting needs swapping.
A fourth fault announces itself as exception 02 on the read: the request spans a hole in the register map. Keep the exchange block contiguous and size it once — Modbus exception 02 when a read crosses a register map gap shows how that fault presents and how to close the gap.
Prove the link before you call it done #
Run the finished link through its failure modes once, on a quiet shift:
- Every tag shows good quality, not only the first few points.
- A value changed in the exchange block reaches InTouch within one update interval, and a write from an InTouch test item appears in the block on the CPU.
- Pull the Ethernet cable: tags go to bad quality, then recover on their own when the link returns, with no DASServer restart.
- Cycle the CPU through STOP and back to RUN: the client reconnects without help.
One safety boundary holds across all of it: machine protection and safety functions live in the PLC, and this link carries supervision and setpoints only.
Decide where the fault sits #
Read the symptom, take the decision:
- Ping fails — the fault is IP address, subnet, VLAN, cabling or firewall. Decision: leave the PLC program alone and fix the network layer first.
- Ping answers, port test refused — no listener. Decision: CPU in STOP, the server call skipped on some scans,
DISCONNECTat TRUE, or a duplicate connection ID; read the program and the watch table. - Port test times out — a firewall or a router on the path is filtering port 502. Decision: allow it there and retest before touching anything else.
- Connects, then an exception on the read — register type or a map gap. Decision: align the item to holding registers and make the exchange block contiguous.
- Data arrives but is shifted or garbled — base or word order. Decision: the worked-example constant separates the two in a single read.
- Transport,
STATUSand the register test all pass, yet InTouch tags stay bad quality — the fault sits inside the SCADA layer. Decision: collect the DASServer diagnostic log, the CPU model and firmware version and the exact Wonderware product and version, and take that set to the vendor's support channel; that is the only case that leaves your desk.
Questions asked
Does choosing between an S7-300 and an S7-1500 change the SCADA side?
No. InTouch and the I/O server see a standard Modbus TCP server in both cases, so the same device definition and register map apply. The difference is on the PLC side: a classic S7-300 serves Modbus TCP through its Ethernet communications processor rather than an onboard CPU port, while the S7-1500 and S7-1200 run MB_SERVER on the integrated PROFINET port. Confirm the exact communications processor's Modbus TCP support in its manual before the hardware order goes out.
Can InTouch write setpoints back into the CPU over this link?
Yes. Items defined as holding registers are readable and writable in Modbus, so a write from the SCADA side lands in the same exchange block the server exposes. Reads use Modbus function 3; writes arrive as the standard write commands and appear in the block on the next server cycle. Verify a write with a test item first, and treat the exchange area as owned output of the SCADA side: clamp and validate every setpoint before process logic uses it.
Why does every tag drop to bad quality when I put the CPU into STOP?
MB_SERVER executes only while the CPU runs, so the passive listener closes with the scan and the I/O server loses its session; InTouch marks its items bad quality. Nothing is misconfigured. When the CPU returns to RUN, the server accepts connections again and the client reconnects on its own. Prove that recovery once, with a deliberate STOP/RUN cycle and a deliberate cable pull, as the commissioning checks ask.
Do I need extra communication hardware for Modbus TCP on an S7-1200?
No. The manufacturer's documentation for MB_SERVER states that it communicates as a Modbus TCP server through the PROFINET port on the S7-1200 CPU and that no additional communication hardware module is required. The same call pattern runs on the S7-1500's integrated port. A separate communications module earns its slot only when you need a second physical network, not for this link.
How do I keep the SCADA link from disturbing the process program?
Keep one writer per value: the PLC writes the values it owns and the SCADA side writes only agreed setpoints into the exchange block. Read STATUS every scan and raise an alarm in the PLC when the server reports a fault, so operators see a dead link instead of stale numbers, and let the SCADA side log the same event for the network history.