S7-1200 CM1241 RS-485: Resolving Zero-Byte Transmission to Modbus Pressure Sensors
The S7-1200 family paired with a CM1241 communication module is one of the most common point-to-point Modbus RTU masters in mid-sized machine automation. When the module suddenly stops communicating with a previously working sensor and a serial sniffer or USB-RS485 adapter on the bus shows the controller transmitting only 0x00 bytes at a fixed interval, the failure is almost always configuration-related rather than hardware damage. This reference covers the root cause, the field-proven repair path, and the verification steps that should be performed on every CM1241 RS-485 link after any re-commissioning event.
1. Problem Statement and Observable Symptoms
The fault pattern reported in the field is highly specific and points to a deterministic root cause:
- Controller: Siemens SIMATIC S7-1200 (CPU 121xC or 121x FC, firmware 4.x or later).
- Module: CM 1241 communication module, RS-485 variant (6ES7241-1CH30-1XB0, 6ES7241-1CH32-1XB0, or the newer 6ES7241-1CH40-1XB0).
- Slave: Industrial pressure transducer using Modbus RTU, typically configured for 9600 8N1.
- Behavior after the PLC is re-energised: A PC running a Modbus master (e.g., Modbus Poll, QModMaster, or simply a USB-RS485 adapter and serial terminal) sees the CPU emit a steady stream of
0x00 0x00 0x00 ...at one-second intervals, with no response from the slave and no valid Modbus request frame on the bus. - Physical layer proven good: The same cable, the same sensor, and the same RS-485 adapter have already been verified on a third-party PLC, so the wiring, biasing resistors, and sensor are exonerated.
The 0x00 flood is a signature. The CM1241 is generating a transmit request on the wire, but the data it is sending is null. This is what the firmware does when the MB_MASTER block is called with an illegal or uninitialised data pointer, or — far more commonly — when the COMM_LOAD block has not been executed with the correct MODE value for the RS-485 variant of the module.
2. Hardware Identification: Which CM 1241 Do You Have?
Siemens ships the CM 1241 in three RS-485-capable variants and one RS-232-only variant. Each requires different configuration of the MODE input of COMM_LOAD. Confirm the catalog number on the side of the module before proceeding.
| MLFB (Catalog No.) | Interface | Protocols Supported | MODE Value (Hex) | Max Baud |
|---|---|---|---|---|
| 6ES7241-1CH30-1XB0 | RS-485 | Modbus RTU Master/Slave, USS, Freeport | 4 | 115.2 kbit/s |
| 6ES7241-1CH32-1XB0 | RS-485 | Modbus RTU Master/Slave, USS, Freeport | 4 | 115.2 kbit/s |
| 6ES7241-1CH40-1XB0 | RS-485 (terminal block) | Modbus RTU Master/Slave, USS, Freeport | 4 | 115.2 kbit/s |
| 6ES7241-1AH30-1XB0 | RS-232 | Modbus RTU, Freeport | 0 or 1 | 115.2 kbit/s |
| 6ES7241-1AE30-1XB0 | RS-232 | Freeport only | 0 or 1 | 115.2 kbit/s |
The MODE parameter selects the electrical interface and the half-duplex/full-duplex behaviour. For every RS-485 variant listed above the parameter must equal 4. MODE values 0 through 3 select RS-232 operation; selecting 0, 1, 2, or 3 on a true RS-485 module results in a driver mismatch that produces exactly the 0x00 flood symptom described in the field report.
3. Required Software and Firmware Versions
Before changing any code, confirm the engineering software matches the controller firmware. Mixing versions is the second most common cause of silent Modbus failure on the CM1241.
| TIA Portal | CPU Firmware | Modbus Library | COMM_LOAD / MB_MASTER Version |
|---|---|---|---|
| V13 SP1 | V4.0 / V4.1 | SIMATIC S7-1200 Modbus/TCP V1.2 (PtP part) | V1.2 |
| V14 SP1 | V4.2 | MODBUS_PnPn V1.3 | V1.3 |
| V15 / V15.1 | V4.3 / V4.4 | MODBUS_PnPn V2.0 (rename to PtP Modbus) | V2.0 |
| V16 / V17 / V18 | V4.4 / V4.5 / V4.6 | PtP Modbus RTU block library | V2.0+ |
The library block names changed between TIA V14 and V15: MB_COMM_LOAD became COMM_LOAD, and MB_MASTER kept its name. Old instance DBs from V13/V14 do not retain their configuration when migrated to V15+. Always delete the instance DBs of COMM_LOAD and MB_MASTER before re-instantiating, otherwise stale MODE = 0 or MODE = 1 values from a previous RS-232 project will persist.
4. The Root Cause: COMM_LOAD MODE ≠ 4
Every PtP communication sequence on the S7-1200 requires two blocks in a strict order:
-
COMM_LOAD (formerly MB_COMM_LOAD) — configures the CM 1241 hardware interface, baud rate, parity, flow control, and crucially the
MODEvalue. The block is a one-shot: it must be executed exactly once on CPU cold start, usually inOB100(warm restart) or the first scan ofOB1with a positive-edgeREQtrigger. -
MB_MASTER — performs the Modbus RTU transactions. It must not be called until
COMM_LOAD.DONE= TRUE andCOMM_LOAD.ERROR= FALSE.
If COMM_LOAD is called with REQ and completes successfully (DONE = TRUE, ERROR = FALSE, STATUS = 0), the CM 1241 is armed and ready. If MB_MASTER is then called and the bus shows only 0x00 bytes, the issue is one of the following, in order of probability:
| Rank | Cause | Symptom on Bus | MB_MASTER STATUS |
|---|---|---|---|
| 1 | MODE ≠ 4 for an RS-485 module (most common: MODE = 0 carried over from RS-232 example project) | 0x00 0x00 0x00 0x00 ... at fixed interval | 16#7002 or 16#80C8 |
| 2 | MB_MASTER called before COMM_LOAD completes | No transmission at all, or single 0x00 | 16#7001 / 16#80C8 |
| 3 | DATA_ADDR or DATA_LEN outside the Modbus address space of the slave | Valid Modbus request, no response from slave, eventually 16#80C8 timeout | 16#80C8 (timeout) |
| 4 | Baud rate / parity mismatch between PLC and sensor | Garbled bytes on bus, slave never responds | 16#80C8 (timeout) |
| 5 | RS-485 A/B polarity swap (Siemens labels are reversed from generic convention) | 0x00 flood or permanent BUSY | 16#80C8 (timeout) |
5. Step-by-Step Repair Procedure
Execute these steps in order. Do not skip the verification block at the end of each step.
Step 5.1 — Open the Project in TIA Portal
- Open the project that previously worked with the pressure sensor.
- Open the device configuration of the S7-1200 station and confirm the CM 1241 is in slot 101 of the PLC with the correct MLFB.
- Right-click the CM 1241 → Properties → Port configuration. Set the baud rate, parity, and stop bits to match the pressure sensor. For a typical 9600 8N1 sensor, leave the defaults.
- Under Hardware identifier, note the value. It will be a hex constant such as
271(decimal 625). This is theHW_IDinput ofCOMM_LOAD.
Step 5.2 — Open the Instance DB of COMM_LOAD
- Navigate to the program block that contains
COMM_LOAD(oftenOB1or a dedicated init FB). - Right-click the
MODEinput tag → Go to tag or open the instance DB directly. - Verify
MODE= 4 (decimal) for any RS-485 CM 1241 module.
Tag table or the call site of the block and inspect the literal or variable feeding MODE. A common defect is a previously declared WORD tag named "Mode" that retained a value of 0 from a past RS-232 project.Step 5.3 — Force-Cold-Start the Project
- Perform a full download of the project, not a delta download. TIA Portal may otherwise skip the instance DB if its interface signature is unchanged.
- After download, power-cycle the S7-1200 (MRES is not required, but a clean power cycle ensures the instance DBs are re-initialised).
- Monitor the instance DB of
COMM_LOADonline.DONEshould transition to TRUE within one PLC cycle, andSTATUSshould equal 0.
Step 5.4 — Verify COMM_LOAD Status Online
Connect online to the PLC, open the COMM_LOAD instance DB in monitor mode, and check the following tags:
| Tag | Type | Expected Value (Healthy) | Fault Indication |
|---|---|---|---|
| REQ | BOOL | TRUE on first scan, then FALSE | Always FALSE → block never executed |
| DONE | BOOL | TRUE after first cycle | Stays FALSE → see STATUS |
| ERROR | BOOL | FALSE | TRUE → see STATUS |
| STATUS | WORD | 0 | 16#80C1, 16#80C2, 16#80C3, 16#80C4 (see Section 8) |
| MODE | UINT | 4 for RS-485 | 0, 1, 2, or 3 → driver mismatch |
Step 5.5 — Trigger MB_MASTER After COMM_LOAD is DONE
Wire MB_MASTER with the following minimum parameters:
// MB_MASTER call parameters (example for a 9600 8N1 pressure sensor, slave ID 1)
MB_MASTER_DB.MODE := 0; // 0 = Modbus RTU
MB_MASTER_DB.SLAVE := 1; // Slave address 1
MB_MASTER_DB.FUNCTION := 3; // Read Holding Registers
MB_MASTER_DB.DATA_ADDR := 0; // Starting Modbus register 40001
MB_MASTER_DB.DATA_LEN := 2; // Read 2 registers (16-bit pressure + status)
MB_MASTER_DB.DATA_PTR := P#DB20.DBX0.0 WORD 2; // Pointer to a 2-word data buffer in DB20
MB_MASTER_DB.REQ := _Trigger; // Rising-edge trigger, NOT level
MB_MASTER_DB.BUSY := _Busy; // Latched while transaction in progress
MB_MASTER_DB.DONE := _Done; // One-cycle pulse on success
MB_MASTER_DB.ERROR := _Error; // One-cycle pulse on failure
MB_MASTER_DB.STATUS := _Status; // 0 on success, error code on failure
REQ is edge-triggered, not level-triggered. Latch it in a one-shot using a rising-edge detector: _Trigger := _TrigInput AND NOT _TrigInput_Last; _TrigInput_Last := _TrigInput;. Driving REQ with a level signal causes the CM1241 to re-issue the request every cycle, which on the bus looks like the 0x00 flood symptom if the underlying MODE configuration is wrong.6. RS-485 Wiring and Polarity
Siemens uses non-standard A/B pin naming on the CM 1241. This is the most common installation error in the field and is worth verifying before any software change.
| Pin (Sub-D 9 male) | Siemens Label | Generic / Modbus Convention | |
|---|---|---|---|
| 3 | T/R+ | Data+ / B (some vendors) | Non-inverting line |
| 8 | T/R- | Data- / A (some vendors) | Inverting line |
| 5 | GND | GND | Reference ground |
| 7 | +5V (optional) | — | Bias supply, do not connect externally |
Siemens' T/R+ corresponds to the generic D+ signal. The bus will function with either polarity, but if a half-duplex device is on the same bus with a third-party master, the polarity conventions may collide. Confirm with a multimeter: between T/R+ and T/R- the bus should idle at ≥ +200 mV differential on a healthy RS-485 segment terminated with 120 Ω at both ends.
Termination: the CM 1241 does not include internal termination resistors. For a 9600 bit/s link under 10 m, no termination is required. For 115.2 kbit/s or cable runs above 10 m, add a 120 Ω resistor between T/R+ and T/R- at both ends of the bus, and a 680 Ω pull-up to +5V on T/R+ and a 680 Ω pull-down to GND on T/R- at exactly one point on the bus. Many third-party pressure sensors have DIP switches for these resistors.
7. Freeport vs. Modbus: Why You Cannot Mix MODE Values
A common misconception is that MODE controls only the electrical standard. In reality, MODE also selects the framing protocol interpreted by the firmware. The valid combinations are:
| MODE (Decimal) | Interface | Framing | Compatible Blocks |
|---|---|---|---|
| 0 | RS-232 | Full-duplex, no flow control | SEND_P2P / RCV_P2P, MB_MASTER (RS-232 only) |
| 1 | RS-232 | Full-duplex, XON/XOFF | SEND_P2P / RCV_P2P |
| 2 | RS-232 | Full-duplex, RTS/CTS hardware handshake | SEND_P2P / RCV_P2P |
| 3 | RS-232 | Full-duplex, XON/XOFF + RTS/CTS | SEND_P2P / RCV_P2P |
| 4 | RS-485 | Half-duplex, no flow control | MB_MASTER, MB_SLAVE, SEND_P2P, RCV_P2P |
| 5..15 | Reserved | — | — |
Selecting MODE = 0 on an RS-485 module tells the firmware to use the RS-232 line driver. The RS-485 line driver, however, is the only one physically wired to the bus pins. The result is a configuration race: the firmware is shifting out Modbus bytes through the wrong driver, and the line driver is held in receive-only mode. The bus idles at 0x00.
8. Common COMM_LOAD and MB_MASTER Error Codes
After applying the fix, monitor the STATUS outputs in online mode. The following codes are the most frequently encountered on CM 1241 Modbus links:
| STATUS (Hex) | Block | Meaning | Remedy |
|---|---|---|---|
| 16#0000 | Both | No error | — |
| 16#7001 | MB_MASTER | Block is busy processing the previous request | Wait for DONE/ERROR, do not retrigger REQ |
| 16#7002 | MB_MASTER | Block is waiting for COMM_LOAD to complete | Ensure COMM_LOAD DONE = TRUE |
| 16#80C1 | COMM_LOAD | Wrong HW_ID or wrong module type | Re-check device configuration; verify MLFB |
| 16#80C2 | COMM_LOAD | MODE value not supported by this module | Use 4 for RS-485, 0/1/2/3 for RS-232 |
| 16#80C3 | COMM_LOAD | Baud rate outside the supported range | Use 300 / 600 / 1200 / 2400 / 4800 / 9600 / 19200 / 38400 / 57600 / 76800 / 115200 |
| 16#80C4 | COMM_LOAD | Parity value invalid (must be 0, 1, or 2) | 0 = None, 1 = Odd, 2 = Even |
| 16#80C8 | MB_MASTER | Slave response timeout (default 1 s, configurable 5 ms – 55 s) | Check slave address, baud, parity, polarity, cable |
| 16#8181 | MB_MASTER | DATA_PTR is invalid or not large enough | Re-verify the ANY pointer; check DATA_LEN × element size |
| 16#8182 | MB_MASTER | DATA_ADDR + DATA_LEN exceed slave address space | Reduce DATA_LEN or change starting register |
| 16#8183 | MB_MASTER | Function code not supported by slave | Confirm slave supports FC 1, 2, 3, 4, 5, 6, 15, or 16 |
| 16#8184 | MB_MASTER | Modbus exception from slave (see DATA_PTR[0] for exception code) | See exception code 01/02/03/04 below |
Modbus exception codes reported in the first byte of the data buffer when STATUS = 16#8184:
| Exception Code | Name | Meaning |
|---|---|---|
| 01 | Illegal Function | Slave does not support the requested FC |
| 02 | Illegal Data Address | DATA_ADDR is not valid in the slave map |
| 03 | Illegal Data Value | DATA_LEN or value out of range |
| 04 | Slave Device Failure | Internal slave error (sensor fault, watchdog, etc.) |
| 05..06 | Acknowledge / Slave Busy | Slave is processing; retry with delay |
| 08 | Memory Parity Error | Slave internal memory issue |
| 0A / 0B | Gateway Path / Response | Gateway-related, rare on direct-attached slaves |
9. Verification Procedure
After applying the MODE = 4 fix and re-downloading, perform the following three-level verification. Do not declare the link healthy until all three pass.
9.1 LED Verification
The CM 1241 RS-485 has a single bi-colour LED per port. Observe it with the project running and a Modbus REQ pulse active:
| LED State | Meaning |
|---|---|
| Green, steady | Link healthy, configuration accepted (COMM_LOAD DONE = TRUE) |
| Green, flashing | Receiving or transmitting (normal during transaction) |
| Red, steady | Configuration error or hardware fault |
| Red, flashing | Configuration error during parameter assignment (check STATUS) |
| Off | No power, or module not initialised |
9.2 Online STATUS Verification
With the PLC online, force REQ on MB_MASTER via a watch table. Confirm:
COMM_LOAD.STATUS = 16#0000-
MB_MASTER.DONE = TRUEon the cycle following the trigger MB_MASTER.ERROR = FALSE- The data buffer at
DATA_PTRcontains the expected sensor value
9.3 Bus-Side Verification
Connect a USB-RS485 adapter to the bus (temporarily disconnect the CM1241 to avoid contention, or use a 3-port RS-485 tap with appropriate impedance). Run Modbus Poll or QModMaster and issue a Read Holding Registers request to the slave address. The sensor should respond identically to the CM1241 query — proving the slave and cable are good. Then reconnect the CM1241 and confirm the PLC receives the same data.
10. Avoiding the 0x00 Flood in the Future
Three engineering practices will eliminate the recurrence of this specific failure mode on any S7-1200 / CM1241 site:
-
Standardise the project template. Build a master project with the correct
MODE = 4baked into theCOMM_LOADinstance DB. Any project cloned from this template inherits the correct value. Mark theMODEtag with a comment such as // 4 = RS-485, do not change without verifying module type. -
Make COMM_LOAD execution mandatory in OB100. Use the warm-restart OB to call
COMM_LOADwith a latchedREQand a watchdog timer that flags a station ifDONEis not TRUE within 5 seconds of power-up. This protects against the case where the OB is later removed during a code cleanup. -
Use a one-shot trigger for MB_MASTER. Never drive
MB_MASTER.REQwith a level signal. Latch it with a rising-edge detector and verify thatBUSYtransitions to FALSE and back to TRUE for each transaction. A level-driven REQ on a mis-configured CM1241 produces the 0x00 flood exactly once per second, which is the symptom reported in the original incident.
11. Extended Diagnostics: When MODE = 4 Still Fails
If the MODE parameter is correct and the bus is still silent or still transmitting 0x00, escalate to the following diagnostics in order:
| Test | Procedure | Expected (Pass) | Fault Indication |
|---|---|---|---|
| Loopback test | Connect T/R+ to T/R- and GND to GND on the CM1241 with no slave attached. Send any Modbus request. | STATUS = 16#80C8 (timeout) is normal; no exception from slave means physical layer OK. | STATUS = 16#8181 → instance DB pointer corrupt |
| External master test | Disconnect the CM1241, attach a USB-RS485 adapter, and run Modbus Poll as master. | Sensor responds with valid registers. | No response → slave, wiring, or termination issue |
| OSI layer check | Use a Modbus sniffer (e.g., Simply Modbus, Modbus Tools) in line-tap mode. | Modbus RTU frames with correct CRC visible. | Garbled frames → baud rate, parity, polarity |
| Firmware check | Read CM1241 firmware via TIA Portal online → Diagnostics → Module Information. | FW ≥ 2.0 for CH30, ≥ 3.0 for CH32, ≥ 4.0 for CH40. | Older firmware has known MODE = 4 bug fixed in v2.1.0 of CH30. |
| Module swap | Replace the CM1241 with a known-good unit. Do not change code. | Communication restored. | Original module has line driver damage (ESD or 24V on RS-485 pins). |
12. Frequently Asked Questions
Why does my CM 1241 RS-485 only send 0x00 bytes?
The CM 1241 transmits a stream of 0x00 bytes when the MODE input of the COMM_LOAD block is not set to 4. For every RS-485 variant of the CM 1241 (6ES7241-1CH30/CH32/CH40-1XB0), MODE must equal 4. Values 0 through 3 select RS-232, which uses a different line driver and produces the 0x00 idle pattern on the RS-485 bus.
What is the difference between MB_COMM_LOAD and COMM_LOAD?
They are the same block. The name was changed from MB_COMM_LOAD to COMM_LOAD in TIA Portal V15 to reflect the fact that the same block configures both Modbus RTU and Freeport modes. Instance DBs from V13/V14 are renamed automatically during migration, but the MODE value is preserved. Always verify MODE = 4 for RS-485 after any project migration.
Can I run MB_MASTER before COMM_LOAD is DONE?
No. MB_MASTER checks a hardware flag that COMM_LOAD sets. If MB_MASTER is called before the flag is set, it returns STATUS = 16#7002 and does nothing. Wire your code so that MB_MASTER.REQ is only true when COMM_LOAD.DONE = TRUE AND COMM_LOAD.ERROR = FALSE.
How do I test if my CM 1241 is damaged or misconfigured?
Disconnect the sensor and connect the CM1241 T/R+ to T/R- and GND to GND with a short wire (loopback). Trigger an MB_MASTER read. A healthy module will return STATUS = 16#80C8 (timeout, since no slave is present) and a working line driver. If the same test produces STATUS = 16#8181 or no activity on a USB-RS485 sniffer, the module itself is suspect.
Which TIA Portal version is required for the CM 1241 RS-485 Modbus master?
TIA Portal V13 SP1 with the "MODBUS_PN_PN" library or later will work. TIA V15 and later use the renamed PtP Modbus library and COMM_LOAD name. The function-block logic is identical, but the instance DBs must be re-created when migrating projects. CPU firmware V4.2 or later is recommended for full RS-485 half-duplex stability under 115.2 kbit/s.