Overview
Integrating a fire alarm central with a SIMATIC S7-1200 over RS485 Modbus RTU is a standard application when the fire panel exposes a protocol converter (Modbus RTU slave) and the PLC must act as the master. The PLC reads smoke detector and glass-break statuses from the central, evaluates the fire-event logic, drives door-holding electromagnets, and forwards the state to an Elipse E3 SCADA for plant-wide visualization. This reference documents the complete path: hardware selection, TIA Portal configuration, Modbus RTU master block selection, register mapping, output control, SCADA coupling, and field commissioning.
Prerequisites
| Item | Required Specification |
|---|---|
| CPU | S7-1200 firmware V4.0 or higher (V4.2+ recommended for full Modbus RTU library); 1212C, 1214C, 1215C, or 1217C |
| Communication module | 6ES7241-1CH32-0XB0 (CM 1241 RS422/485) — order number for the 9-pin Sub-D variant. Older 6ES7241-1CH30-0XB0 supported but EOL; firmware must match the CPU family |
| Engineering tool | STEP 7 Basic / TIA Portal V13 SP1 or later; V16 or V17 preferred |
| Modbus RTU library | "Modbus" instruction package — included in the TIA Portal "Communication" palette; no additional HSP required for S7-1200 |
| Fire central protocol converter | Modbus RTU slave, RS485 two-wire, 9600 bit/s typical, 8E1 framing |
| Cabling | Shielded twisted pair, characteristic impedance 120 Ω, max bus length 1200 m at 9600 bit/s, terminated at both ends with 120 Ω |
| SCADA | Elipse E3 with OPC DA/UA driver or native Modbus gateway |
CM 1241 RS422/485 Hardware Configuration
The CM 1241 RS422/485 module presents a 9-pin female Sub-D connector. For Modbus RTU on a two-wire RS485 bus, use the pin assignment shown below. Do not connect any signal to the unused RS422 pins; leave them floating or tied to ground per the manufacturer's grounding policy.
| Pin (Sub-D 9) | Signal | Function |
|---|---|---|
| 1 | Shield | Chassis/functional ground — bond at one end only |
| 2 | T/R+ (RA) | RS485 non-inverting (Data+) |
| 3 | TxD+ (not used in 2-wire) | RS422 transmit only |
| 4 | RTS (TTL) | Direction control for RS485 transceivers that need it; not used by Modbus RTU library |
| 5 | M / GND | Signal common (0 V) |
| 6 | +5 V (40 mA max) | Termination bias supply on selected modules only |
| 7 | T/R- (RB) | RS485 inverting (Data−) |
| 8 | RxD+ (not used in 2-wire) | RS422 receive only |
| 9 | RxD- (not used in 2-wire) | RS422 receive only |
Enable the 120 Ω termination at the two physical ends of the RS485 bus only. The CM 1241 has no internal termination resistor — install an external 1/4 W 120 Ω resistor between T/R+ (pin 2) and T/R- (pin 7) at each end. The fire central's protocol converter typically has a switch or jumper for end-of-line termination; engage it if it is the last device.
TIA Portal Project Setup
- Open TIA Portal and create a new project. Add the S7-1200 CPU and the CM 1241 RS422/485 module to the device configuration. Match the order number and firmware version exactly to the physical hardware.
- Open Device view, click the CM 1241 module, and select Properties → RS422/485 interface. Set the transmission rate, parity, and stop bits to match the fire central (typically 9600 bit/s, even parity, 1 stop bit). Set Flow control to None.
- Confirm the module's hardware identifier (for example, HW_ID 270) — you will pass it to MB_COMM_LOAD.
- Add a global data block (DB) named ModbusData to hold the polling buffer, request structure, and status word. The Modbus instruction package requires a separate DB instance per MB_MASTER call.
Block Selection: Modbus RTU vs Point-to-Point
This is the most common point of confusion on first-time CM 1241 deployments. The two libraries are mutually exclusive on a single port, and the wrong choice always manifests as either silent failure (no response) or garbled frames (CRC errors).
| Criterion | Modbus RTU library | PtP library |
|---|---|---|
| Block names | MB_COMM_LOAD, MB_MASTER, MB_SLAVE, MB_CLIENT, MB_SERVER | PORT_CFG, SEND_CFG, RCV_CFG, SEND_PTP, RCV_PTP, GET_RCV_BUF |
| Frame handling | Automatic — Modbus ADU build, CRC-16 append/check, inter-frame timing per 3.5 char silence rule | Manual — user builds payload, library only handles byte queue |
| Use case | Any Modbus RTU slave device (fire centrals, VFDs, energy meters, HVAC controllers) | Vendor-specific serial protocols, ASCII devices, custom protocols, debugging |
| Timing control | Inter-frame delay and response timeout configured per instruction | User must enforce 3.5-char silence and round-trip timing |
| For this application | Correct choice | Wrong choice |
MB_COMM_LOAD Configuration
MB_COMM_LOAD is executed once on warm restart or first scan to load the port configuration into the CM 1241. It must finish before any MB_MASTER or MB_SLAVE call uses the port. Wire it behind a first-cycle flag or initialize it from a startup OB.
| Input pin | Value | Notes |
|---|---|---|
| REQ |
FirstScan or one-shot rising edge from a startup tag |
Triggers (re)configuration |
| PORT | RS485 port symbol (e.g., CM_1241_RS485) |
Generated when you drag the CM 1241 from device configuration |
| BAUD | 9600 | Match the fire central exactly |
| PARITY | 2 (Even) | 0=None, 1=Odd, 2=Even |
| FLOW_CTRL | 0 (None) | RS485 2-wire does not use RTS/CTS handshake |
| RTS_ON_DLY | 0 | No RTS toggle needed |
| RTS_OFF_DLY | 0 | — |
| RESP_TO | 1000 | Response timeout in ms; 1000 ms is safe for 9600 bit/s |
| DONE | Bool output | Set when configuration complete |
| ERROR | Bool output | Set on configuration error |
| STATUS | Word output | 16-bit diagnostic word (see error table below) |
MB_MASTER Polling Logic
MB_MASTER performs one transaction per call. To poll a contiguous block of fire-panel registers, call MB_MASTER cyclically — for example from a cyclic OB (OB1, OB30, OB35) gated by a 100 ms timer — using the REQ input as a one-shot edge. The instruction holds DONE true for one cycle on success; reuse the rising edge of DONE or a self-resetting pattern to issue the next request.
| Input pin | Value | Notes |
|---|---|---|
| REQ | One-shot rising edge from poll sequencer | Edge-triggered; do not hold high |
| MB_ADDR | 1..247 per Modbus spec, e.g., 1
|
Slave address from fire central config |
| MODE | 0 = Read holding registers (FC 03) 1 = Read coils (FC 01) 2 = Read input registers (FC 04) 3 = Read discrete inputs (FC 02) 4 = Write single coil (FC 05) 5 = Write single register (FC 06) 6 = Write multiple coils (FC 15) 7 = Write multiple registers (FC 16) 8 = R/W multiple registers (FC 23) |
Fire central sensors typically expose FC 02 or FC 04 |
| DATA_ADDR | Starting Modbus address (1-based) | Subtract 1 from any vendor-supplied "offset" that is already zero-based |
| DATA_LEN | Number of registers / bits | Max 125 registers per Modbus spec; keep within one cycle to avoid partial reads |
| DATA_PTR | Pointer to the destination DB or tag | For FC 03/04/16 use a tag array; for FC 01/02/15 use a Bool array or word with bit-masking |
| DONE | Bool output | True for one cycle on success |
| ERROR | Bool output | True on exception or transport error |
| STATUS | Word output | Diagnostic code (see table below) |
Example ST snippet for cyclic polling of smoke-detector status words starting at Modbus address 40001:
IF MB_Load.DONE AND NOT PollBusy THEN
PollBusy := TRUE;
MB_Master_0.REQ := TRUE; // self-resets on DONE/ERROR
END_IF;
IF MB_Master_0.DONE THEN
PollBusy := FALSE;
END_IF;
If the fire central returns discrete inputs (FC 02) for smoke and glass-break sensors, read the integer word and bit-mask in the application:
SmokeZone1 := (FireInputWord.0 AND 16#0001) <> 0; // bit 0 = smoke detector zone 1
GlassBreak1 := (FireInputWord.0 AND 16#0002) <> 0; // bit 1 = glass break zone 1
Data Mapping and Door Electromagnet Control
A typical fire system partitions the plant into zones. The PLC must close fire doors by de-energizing door magnets (fail-safe) or energizing them (fail-secure) per local fire code. Build a structured mapping table in a global DB to keep the application logic readable.
| Modbus address (1-based) | Function | Source tag | Sink tag / Action |
|---|---|---|---|
| 10001..10016 | FC 02 discrete inputs — smoke detectors | FireInputs[0..15] |
OR-aggregated to FireAlarmActive
|
| 10017..10024 | FC 02 discrete inputs — glass break | FireInputs[16..23] |
OR-aggregated to FireAlarmActive
|
| 30001..30008 | FC 04 input registers — analog detector levels | FireAnalog[0..7] |
Alarm threshold compare |
| 00001..00016 | FC 05 write single coil — door magnets | DoorCmd[0..15] |
Wired to PLC digital outputs QB0 |
| 40001..40004 | FC 06 write single register — central commands (ack, reset, test) | CentralCtrl[0..3] |
Sent from HMI/SCADA |
Implement the closing logic in a fail-safe manner:
// Fail-safe: door closes when ANY alarm is active OR comms with central lost
FireAlarmActive := (Smoke OR GlassBreak) OR CommsFaultLatch;
FOR i := 0 TO 15 DO
DoorCmd[i] := NOT FireAlarmActive; // assumes magnet energizes = door open
END_FOR;
SCADA Integration with Elipse E3
Elipse E3 supports S7-1200 natively via the Siemens TCP/IP Ethernet driver (S7 ISO-on-TCP / S7 Comm) or via OPC UA. Two architectural paths are common:
- Native S7 driver in E3: E3 reads/writes the same tags already declared in the PLC DB. Use this when E3 needs full access to PLC process data — not just the Modbus register mirror. Enable PUT/GET on the S7-1200 in CPU Properties → Protection & Security → Connection mechanisms and allow read/write access.
- OPC UA server on the S7-1200 (firmware V4.4+): Configure the OPC UA server in TIA Portal, expose the door commands and fire status DB, and connect E3 via OPC UA. This is the modern path with proper authentication and encryption.
For the plant map: tag the door magnets with their physical position, drive E3 animation frames from DoorCmd[i], and overlay alarm icons driven by FireInputs[i]. The HMI faceplate updates every SCADA scan (typically 1 s), independent of the Modbus polling cycle.
Verification and Commissioning
- Bus health check: Connect a PC with Modbus Poll to the same bus and confirm each register / coil responds before commissioning the PLC program.
- Single-shot read test: Force MB_MASTER_REQ from a watch table and confirm DONE rises, ERROR stays false, and STATUS = 16#0000. Verify the data buffer contains the expected values.
- Loopback test: Temporarily connect a second CM 1241 in slave mode (MB_SLAVE on the same PLC project or on a bench PLC) and confirm the master reads back the values you write.
-
End-to-end fire simulation: Force a smoke-detector bit in the Modbus test register, watch
FireAlarmActivego true, the door output physically release, and the Elipse E3 map show the correct door closed icon within the configured scan period. -
Loss-of-comms test: Disconnect the RS485 bus.
MB_Master_0.ERRORmust rise,CommsFaultLatchmust set, and the doors must default to the safe state. Confirm the SCADA displays a comms fault banner.
Troubleshooting Matrix
| Symptom | Likely cause | Corrective action |
|---|---|---|
| MB_COMM_LOAD STATUS = 16#8180 | Wrong baud/parity or unsupported parameter | Verify baud, parity, stop bits against the fire central's serial configuration |
| MB_COMM_LOAD STATUS = 16#8181 | Port already in use by another instruction | Check that PtP and Modbus libraries are not both instantiated on the same CM 1241 |
| MB_MASTER STATUS = 16#8380 | CRC error or no response | Inspect cabling, polarity (T/R+ and T/R- must not be reversed), and 120 Ω termination |
| MB_MASTER STATUS = 16#8381 | Function code not supported by slave | Try FC 03 or FC 04; some fire centrals do not expose FC 01/02 |
| MB_MASTER STATUS = 16#8382 | Data address out of range or illegal data address exception | Verify the Modbus address map from the fire central vendor; many are 0-based in their docs |
| MB_MASTER STATUS = 16#8383 | Illegal data value exception | Reduce DATA_LEN; slave may not support the requested quantity |
| MB_MASTER STATUS = 16#8384 | Slave device failure exception | Slave reports internal fault; consult fire central diagnostic display |
| MB_MASTER STATUS = 16#8385 | Response timeout | Increase RESP_TO in MB_COMM_LOAD (1500–2000 ms for 9600 bit/s with retries) |
| DONE never asserts, ERROR true with no STATUS update | Hardware ID mismatch | Re-select the PORT symbol from the device configuration to refresh HW_ID |
| Sporadic CRC errors under load | Missing or duplicate termination, ground loop, common-mode voltage | Install isolator; verify only two terminations on the bus |
| Elipse E3 shows stale data | OPC UA server not started, or wrong tag subscription | Confirm OPC UA server is enabled and reachable; check E3 tag refresh rate |
Reference Documentation
- SIMATIC S7-1200 Programmable Controller — CM 1241 RS422/485 Specifications
- Siemens Industry Online Support — S7-1200 Communication entry page
- STEP 7 Basic in TIA Portal — Modbus RTU master instructions
FAQ
Should I use Modbus blocks or Point-to-Point blocks on the CM 1241 to talk to the fire central?
Always use the Modbus RTU library (MB_COMM_LOAD + MB_MASTER) when the fire central exposes a Modbus RTU slave. The PtP library (PORT_CFG, SEND_PTP, RCV_PTP) is only for non-Modbus serial protocols where you must build the frame manually. Mixing both libraries on the same port is not allowed.
What baud rate, parity, and stop bits should I configure?
Match the fire central exactly. The typical default for industrial fire panels is 9600 bit/s, 8 data bits, even parity, 1 stop bit (8E1). Mismatched parity is the single most common reason for silent CRC failures.
How many Modbus registers can I read in one MB_MASTER call?
Up to 125 holding or input registers per request (Modbus spec limit). For discrete inputs and coils the limit is 2000 bits per request. Keeping requests small improves bus latency and reduces the impact of a single CRC error.
What STATUS code means CRC error from the slave?
MB_MASTER STATUS = 16#8380 indicates a CRC error or no response on the bus. Check wiring polarity (T/R+ vs T/R-), confirm 120 Ω termination at both bus ends only, and verify the slave address matches MB_ADDR.
How does Elipse E3 get the data from the PLC?
Elipse E3 can connect to the S7-1200 over the Siemens TCP/IP Ethernet driver (S7 ISO-on-TCP) or via the OPC UA server built into firmware V4.4+. The Modbus RTU master data already in the PLC DB can be exposed to E3 by writing those tags to the DB; E3 then reads the same DB over Ethernet, avoiding a second bus.
What happens if RS485 communication is lost during a fire event?
Design the application for fail-safe operation: latch a comms-fault bit when MB_MASTER.ERROR rises, OR it into FireAlarmActive, and default all door magnets to the safe position (typically released). This ensures the building code requirement is met even when the PLC loses the Modbus link.