1. Problem Overview
A common commissioning issue on the SIMATIC S7-1200 platform is the inability of the CPU to read process data from a long RS485 daisy-chain of Modbus RTU slaves. The reported scenario uses a Siemens CB 1241 RS485 communication board plugged into the front of an S7-1200 CPU to interrogate 25 Modbus RTU flowmeters over a single two-wire RS485 trunk. Symptoms at first power-up are typically: no response from any slave, intermittent responses from a subset of slaves, or CRC / framing errors that flood the MB_MASTER status word.
This reference walks through every layer that has to be correct before a single register can be read: the CB 1241 electrical interface, the RS485 topology rules for 25 unit loads, cable selection, termination, bias, Modbus RTU parameter set, TIA Portal device configuration, the Modbus_Master instruction, slave addressing, polling strategy, and finally the diagnostic procedure to localise the failing segment. Use it as a commissioning checklist rather than a single read-through document.
2. Prerequisites
-
CPU: S7-1200 with a free front connector slot. The CB 1241 (article number
6ES7241-1CH30-1XB0) is supported on CPUs with firmware V2.0 and higher; firmware V4.x is recommended for current TIA Portal versions. - Communication board: CB 1241 RS485 (signal board, 6ES7241-1CH30-1XB0) or CM 1241 RS485 (communication module, 6ES7241-1CH32-0XB0). Both support Modbus RTU master; the CM 1241 is hot-swappable and is the preferred choice for industrial sites.
-
Engineering: TIA Portal V15.1 or higher. The instruction set shipped with the "MODBUS" library differs between V13 (legacy
MB_MASTER/MB_SLAVE) and V14+ (renamedModbus_Master/Modbus_Slavewith extended status). Use the library that ships with your TIA version. - Flowmeters: 25 units with a documented Modbus RTU register map. Obtain the default baud rate, parity, slave address, register base, and function codes supported from the vendor manual before energising the bus.
- Cable: Twisted-pair, shielded, characteristic impedance 120 Ω, e.g. Belden 3106A or Lapp UNITRONIC BUS LD. Length must be calculated from baud rate (see Section 5).
- Termination: 120 Ω at each physical end of the trunk. Bias resistors (typically 680 Ω to +5 V on B, 680 Ω to GND on A) only if no slave provides internal bias.
3. CB 1241 RS485 Hardware Specifications
The signal board is a half-duplex RS485 transceiver with a 9-pin sub-D or screw-type removable terminal block, depending on variant. Electrical and protocol-relevant parameters from the S7-1200 system manual collection on the Siemens documentation portal (CB 1241 RS485 specifications) are summarised below.
| Parameter | Value | Comment |
|---|---|---|
| Article number | 6ES7241-1CH30-1XB0 | RS485 signal board (CB) |
| Form factor | Signal board, front slot | Occupies the CPU's signal-board slot; no backplane address |
| Standard | TIA/EIA-485 (ISO/IEC 8482) | Half-duplex, 2-wire differential |
| Maximum unit loads | 32 (1/8 UL per receiver) | 25 flowmeters = 25 UL, within spec |
| Maximum cable length | 1200 m at ≤ 100 kbps, derates with baud rate | See Section 5 |
| Supported baud rates | 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, 115200 bps | Flowmeters typically 9600 or 19200 |
| Parity | None, Even, Odd, Mark, Space (configurable) | Match slave default |
| Data bits / stop bits | 8 / 1 or 8 / 2 | Modbus RTU mandates 8 data bits |
| Internal termination | None (no on-board resistor) | External 120 Ω required at trunk ends |
| Internal bias | None | External pull-up / pull-down required for floating bus |
| Galvanic isolation | Yes (to CPU logic) | Shield grounding handled separately |
| CPU cycles per Modbus transaction | Typically 50–200 ms at 9600 bps | Depends on number of registers polled |
4. RS485 Daisy-Chain Topology Rules for 25 Nodes
Modbus RTU over RS485 uses a single two-wire bus shared by all slaves. The topology is a bus, not a star or a ring. A daisy-chain that branches away from the trunk is a stub and degrades signal integrity.
| Rule | Limit | Reason |
|---|---|---|
| Maximum nodes per bus | 32 unit loads (TIA/EIA-485) | Each transceiver presents 1/8 to 1 unit load; 25 flowmeters leave margin |
| Stub length (T-branch) | ≤ 3 m at 9600 bps, ≤ 0.3 m at 115200 bps | Stubs appear as unterminated taps and cause reflections |
| Topology | Single bus, two 120 Ω terminations, no spurs | Reflected waves corrupt bits at higher baud rates |
| Cumulative stub length | ≤ 30 % of trunk length at 9600 bps | Empirical rule from TIA-485 application notes |
| Direction of wiring | Linear, no loops | Loops pick up CM noise and break the bus |
For 25 flowmeters, the physical cabling should run from the CB 1241 terminal block into junction box 1, then continue in a straight line to junction box 2, 3, … 25. Each flowmeter is connected via a short, equal-length tap of typically 1 m. The first 120 Ω termination sits at the last flowmeter in the chain (junction box 25), the second 120 Ω termination sits at the CB 1241 itself. Never place a termination on an intermediate flowmeter: the resistors are only required at the two electrical ends.
5. Cable Selection and Maximum Length
Use a shielded twisted pair with a characteristic impedance of 120 Ω and capacitance of ≤ 40 pF/m. Cable capacitance is the dominant limit on long runs because it slows the edge rates of the differential signal. The Modbus Organization's "Modbus over serial line" specification gives the following conservative envelope:
| Baud rate (bps) | Maximum trunk length with ≤ 40 pF/m cable | Recommended for 25 nodes |
|---|---|---|
| 9600 | ≤ 1200 m | Yes (typical for flowmeters) |
| 19200 | ≤ 1000 m | Yes, if cable is short |
| 38400 | ≤ 700 m | Marginal |
| 57600 | ≤ 500 m | Not recommended for 25 nodes |
| 115200 | ≤ 250 m | Do not use for 25-node chains |
For a 25-flowmeter daisy-chain, 9600 bps is the safest default. It provides the longest cable budget and the highest noise immunity. If your cable is longer than 800 m, drop to 4800 bps.
Pin-out at the CB 1241 (RS485) terminal block is:
- Pin 1 (or T+ on the screw block): A (inverting, also labelled D-)
- Pin 2 (or T- on the screw block): B (non-inverting, also labelled D+)
- Pin 3: GND / reference (connect to the shield at one end only)
- Pin 4 / 5: Shield termination
6. Termination and Bias Resistors
Two electrical conditions must be satisfied for a multi-node RS485 bus to be reliable:
- Termination: a 120 Ω resistor placed in parallel with the bus at each physical end, between A and B. It absorbs the reflected wave and prevents ringing. The total DC load of the bus is therefore the two terminations in parallel = 60 Ω, which sits comfortably above the 54 Ω minimum sink/source capability of the driver.
- Bias: a pull-up resistor on B to +5 V and a pull-down on A to GND, each typically 680 Ω to 4.7 kΩ. The purpose is to hold the bus in a known idle state (logic "1") when no driver is active. Without bias, the differential voltage can drift through the receiver threshold band and generate a stream of "UART break" characters.
Many modern flowmeters have internal bias. Check the vendor manual under "bus termination / bias" or measure with the meter:
- With the PLC powered off, measure DC voltage between A and B. It should be ≥ 200 mV with the correct polarity (A lower than B in the idle state).
- If the reading is 0 mV, no node is providing bias — install external resistors at the master end.
- Measure resistance between A and B with the bus quiescent. A reading of 60 Ω means both terminations are present and no more are needed. A reading of 120 Ω means only one termination is present. A reading of 40 Ω or lower suggests an extra termination on an intermediate node (this must be removed).
7. Modbus RTU Parameter Set
All 25 flowmeters must share a common physical parameter set, and they must have unique logical addresses. The required configuration is:
| Parameter | Typical value | Range | Notes |
|---|---|---|---|
| Baud rate | 9600 bps | 1200 – 115200 | Match every slave to the master |
| Data bits | 8 | Fixed | Modbus RTU mandates 8 |
| Parity | None | None / Even / Odd | Some flowmeters ship with Even; check vendor default |
| Stop bits | 1 (or 2 with no parity) | 1 / 2 | Use 2 stop bits when parity is None for legacy devices |
| Slave address | 1 … 25 (unique) | 1 … 247 | Must be unique per trunk |
| Frame inter-character timeout | 3.5 character times | Fixed by RTU | Determines silent interval between frames |
| Function codes | 0x03, 0x04, 0x06, 0x10 | Per vendor | Flowmeters usually expose 0x03 / 0x04 only |
Program each flowmeter individually using its vendor configuration tool before connecting it to the bus. After every device has been addressed, perform a one-device test on the bench (CB 1241 + a single flowmeter + 120 Ω termination at each end) before commissioning the full 25-node daisy-chain. A 1:1 bench test isolates PLC configuration from bus integrity problems.
8. TIA Portal Device Configuration
Configure the CB 1241 in the device view of TIA Portal:
- Add the S7-1200 CPU to the project.
- In the device view, click the empty signal-board slot of the CPU. Drag the CB 1241 (RS485) from the catalog (article
6ES7241-1CH30-1XB0) onto the slot. - Select the CB 1241 and open Properties → Port configuration.
- Set the protocol to Modbus RTU master (or "Freeport" if you want to drive the port manually — not recommended for 25 slaves).
- Set baud rate = 9600, parity = None, stop bits = 1 (or 2 with no parity), data bits = 8. These values must match every flowmeter on the trunk.
- Set the response timeout to a value larger than the worst-case slave turnaround. 1000 ms is a safe default; 3000 ms covers slow radio-modem-attached devices.
- Optionally enable "Hold last value on comm. error" if the application can tolerate frozen registers during bus outages.
- Compile and download the hardware configuration to the CPU.
The hardware configuration is the most common reason for "we cannot communicate at all" — the port is left in Freeport mode by default on a new CB 1241, and the Modbus_Master instruction will return STATUS = 0x80C8 ("Port is not configured as Modbus master") if the protocol has not been selected.
9. Modbus_Master Instruction Setup
From TIA Portal V14 SP1 onward, use the Modbus_Master instruction (older projects use MB_MASTER; the parameters are functionally identical). Place a single instance data block in the project. The instruction has the following interface:
| Parameter | Direction | Type | Meaning |
|---|---|---|---|
| REQ | IN | Bool | Rising edge starts one transaction |
| MB_ADDR | IN | USInt | Modbus slave address 1 … 25 |
| MODE | IN | USInt | 0 = read holding, 1 = write coil, 2 = write multiple coils, 3 = read/write multiple registers, 4 = read input, 5 = write single register, 6 = write multiple registers |
| DATA_ADDR | IN | UInt | Modbus register address (1-based) |
| DATA_LEN | IN | UInt | Number of words / bits to transfer (max 125 words read, 123 words write) |
| DATA_PTR | IN_OUT | Variant | Pointer to a standard-access DB or a tag array of the required length |
| DONE | OUT | Bool | Transaction completed without error |
| BUSY | OUT | Bool | Transaction in progress |
| ERROR | OUT | Bool | Error flag |
| STATUS | OUT | Word | Detailed error / diagnostic code (see Section 12) |
A typical pattern in a cyclic OB (e.g. OB1) is to use a round-robin scheduler that issues one transaction every 50–100 ms. With 25 flowmeters at 2 registers each (flow + totaliser), a full scan takes 1.25 s to 2.5 s, which is well within process-control requirements.
// OB1 - round-robin Modbus_Master scheduler
// Reads holding register 0 (instantaneous flow) and register 2 (totaliser)
// from 25 flowmeters, slave address 1 .. 25
IF NOT #ModbusMaster_0.Busy THEN
IF #ModbusMaster_0.Done OR #ModbusMaster_0.Error THEN
// advance to next slave on next PLC scan
#iSlaveIndex := #iSlaveIndex MOD 25 + 1;
#iSlaveAddress := INT_TO_USINT(#iSlaveIndex);
END_IF;
#ModbusMaster_0.REQ := TRUE;
ELSE
#ModbusMaster_0.REQ := FALSE;
END_IF;
#ModbusMaster_0.MB_ADDR := #iSlaveAddress; // 1 .. 25
#ModbusMaster_0.MODE := 0; // read holding registers
#ModbusMaster_0.DATA_ADDR := 0; // first register
#ModbusMaster_0.DATA_LEN := 2; // 2 registers
#ModbusMaster_0.DATA_PTR := #FlowData[#iSlaveIndex]; // array[1..25] of 2-word struct
0x80C8 ("another request is being processed"). The round-robin pattern above is the canonical solution.10. Slave Addressing and Polling Sequence
Use the vendor's configuration software to assign unique addresses 1 … 25 to the flowmeters before connecting the trunk. A bus with two devices on the same address will produce a Modbus "collision" that the master will see as CRC or framing errors. A common commissioning sequence is:
- Connect flowmeter 1 only, with termination at both ends (PLC end and flowmeter 1 end). Verify polling.
- Add flowmeter 2 in parallel at the bus. Move the end termination to flowmeter 2. Re-verify.
- Repeat for flowmeter 3 … 25. At each step the polling of slaves 1 … n-1 must continue to succeed.
- If a step fails, the newly added device is the suspect: re-check its slave address, default baud rate, and A/B polarity.
For 25 flowmeters at 9600 bps with 2 registers per request, the per-frame turnaround is approximately 80–120 ms. Plan the OB1 cycle for at least 100 ms per slave, giving 2.5 s scan time, plus a 5–10 % margin for retransmissions.
11. Step-by-Step Commissioning Procedure
- Document the bus. Draw the trunk, label every junction box 1 … 25, mark termination at the PLC and at junction 25, mark the shield-ground point.
- Verify cable impedance. With all devices disconnected, measure A-B resistance at the PLC end. A reading of 60 Ω confirms both terminators are in place and the cable is intact. An open circuit or short circuit at this stage indicates a wiring fault.
- Verify bias. Power the PLC. Measure A-B DC voltage. It should be between +200 mV and +5 V with A lower than B. If it is 0, install external bias resistors at the PLC end (680 Ω pull-up to +5 V on B, 680 Ω pull-down to GND on A).
- Configure the first flowmeter on a bench with a USB-to-RS485 converter and Modbus Poll (or equivalent). Set baud rate, parity, slave address = 1, function code 0x03, register 0.
- Connect the bench-tested flowmeter to the trunk. Download the TIA Portal hardware configuration. Run the project. The first poll on slave 1 must return DONE = TRUE and STATUS = 0.
- Add flowmeters one at a time in numerical order, re-running the polling test after each addition.
- Record per-slave STATUS in a 25-element array. The dashboard should show STATUS = 0 for every device. Any non-zero value is a fault indicator for that specific segment.
- Disconnect the engineering cable (MPI/PROFINET) and run the CPU cold for 30 minutes. Verify the bus comes back up on power-cycle.
12. Common Error Causes and Diagnostic Matrix
The CB 1241 / Modbus_Master combination reports errors as a 16-bit STATUS word. The most frequent values encountered in a 25-flowmeter daisy-chain are listed below.
| STATUS (hex) | Meaning | Most likely cause with 25 slaves | Action |
|---|---|---|---|
| 0x0000 | No error | — | — |
| 0x80C8 | Port not configured as Modbus master | CB 1241 protocol is Freeport | Set port to "Modbus RTU master" in device configuration |
| 0x80D1 / 0x80D2 | Parity / framing error | Baud rate mismatch; A-B swap; EMI on long cable | Check parity, swap A-B, shorten cable, add shield ground |
| 0x80D5 | CRC error | Intermittent contact, missing termination, duplicate slave address | Verify terminations, check address uniqueness |
| 0x80E1 | Slave did not respond (timeout) | Slave address wrong, slave powered off, A-B swap, bus not terminated | Check address and power, verify DC bias |
| 0x80E2 / 0x80E3 | Modbus exception 0x01 / 0x02 | Unsupported function code or register address | Compare to vendor register map |
| 0x80E4 / 0x80E5 | Modbus exception 0x03 / 0x04 | Read length too large, or slave internal error | Reduce DATA_LEN; check slave diagnostics |
| 0x80F7 | Invalid DATA_PTR | Variant pointer is wrong length | Check the data block dimension |
For deeper diagnostics, place a USB-RS485 sniffer in parallel with the bus at the PLC end. Free tools such as the Modbus Organization's "Modbus Poll" + "Modbus Sniff" or commercial packages (e.g. Docklight) decode the bytes and let you see exactly what the master transmits and whether the slave responds. This is the fastest way to distinguish a wiring problem from a configuration problem.
13. Field-Proven Caveats for a 25-Node Bus
- Power supply to the flowmeters. A 25-flowmeter chain can draw tens of amps from the 24 V rail. Use a dedicated PSU with 25 % margin and verify the cable resistance does not drop the bus voltage below the flowmeter minimum at the far end.
- Common-mode voltage. Long RS485 trunks develop a non-zero common-mode voltage between grounds. The CB 1241 isolation rating is 500 V. If the field ground is far from the panel ground, install a fibre-optic Modbus repeater at the half-way point.
- Surge protection. A 25-node trunk on a long cable run is a lightning target. Add surge arrestors (e.g. Phoenix Contact PT-IQ-5-HF) at the panel entry and at the far end of the trunk.
- Documentation. Print the address-to-location map and tape it inside the panel door. The day a flowmeter is replaced, the field engineer will save an hour by knowing that "address 7 is FT-104 on Skid 3".
14. Verification Tests
- Power-cycle the CPU 5 times; the bus must come back up in < 3 s on every cycle.
- Disconnect the power to a single flowmeter; the corresponding STATUS must report timeout (0x80E1) and the other 24 slaves must continue to read correctly.
- Disconnect and reconnect the cable at the PLC end with the bus live; the system must recover within the configured response timeout without a CPU stop.
- Inject a known flow value at the calibration rig of one flowmeter; verify the S7-1200 HMI tag matches within the meter's stated accuracy.
- Log the STATUS of every slave for 24 hours. Any value other than 0x0000 more than 0.1 % of the time indicates a marginal connection; investigate before commissioning sign-off.
15. References to Official Documentation
For the electrical and protocol details, consult the manufacturer manuals:
- CB 1241 RS485 specifications — S7-1200 system manual, communication interfaces section.
- Siemens Industry Online Support — entry page for S7-1200 manuals, application examples, and firmware updates.
How many Modbus RTU slaves can a single CB 1241 support on one daisy-chain?
The CB 1241 / TIA/EIA-485 bus supports up to 32 unit loads. A 25-flowmeter chain leaves 7 UL of margin, which is sufficient for the CB 1241 plus a sniffer. Exceeding 32 UL will cause the driver to fail to meet the ±1.5 V differential output spec and slaves at the far end will see a degraded signal.
What baud rate should I use for 25 flowmeters on RS485?
9600 bps with 8N1 is the most reliable default for a 25-node chain. It allows up to 1200 m of cable, gives 3.5 character times of ≈ 4 ms between frames, and tolerates the cumulative cable capacitance better than 19200 or 38400. Increase to 19200 bps only if the cable is shorter than 500 m and all flowmeters have been verified at that speed on the bench.
Do I need termination resistors on the CB 1241?
Yes. The CB 1241 has no on-board termination. A 120 Ω resistor must be installed between A and B at the CB 1241 end and at the last flowmeter on the trunk. An intermediate flowmeter must not carry a termination resistor; this is the single most common cause of a 25-node bus that "works with 3 devices and fails with 20".
Modbus_Master returns STATUS 0x80E1 on every slave — what is wrong?
0x80E1 means "slave did not respond". Check in this order: (1) CB 1241 port protocol is set to "Modbus RTU master" and not "Freeport"; (2) A and B are not swapped; (3) at least one node on the trunk provides bias (measure > 200 mV DC between A and B); (4) the slave address in MB_ADDR matches the flowmeter; (5) baud rate and parity match the flowmeter default. Use a USB-RS485 sniffer to confirm whether the master is transmitting at all.
Can the CB 1241 drive 25 flowmeters at 19200 bps with 200 m of cable?
Yes, with careful installation. Use a shielded twisted pair of 120 Ω characteristic impedance, 120 Ω termination at both ends, bias resistors at the PLC end, and verify every flowmeter individually before connecting it to the bus. If the trunk is longer than 500 m, drop to 9600 bps; if it is longer than 1000 m, drop to 4800 bps or insert a Modbus repeater.