Overview
The Siemens SIMATIC S7-1217C is the largest CPU in the S7-1200 family and ships with 14 onboard 24 V DC digital inputs, 10 digital outputs, 2 analog inputs, 2 analog outputs, and 2 PROFINET ports. A frequent question that arises in TIA Portal projects is whether the CPU's onboard differential inputs can be used as an RS-485 communication port. The short answer is no: those differential inputs belong to the high-speed counter (HSC) and pulse-generator block and are not electrically or protocol-equivalent to EIA-485. The correct way to add RS-485 to a 1217C is to plug a CB 1241 RS-485 signal board under the CPU, or to snap a CM 1241 RS-422/485 communication module to the left of the CPU. Both are fully supported from TIA Portal V14 onward.
This article explains the hardware architecture, the electrical reasons why differential digital inputs cannot act as RS-485, the catalog numbers and specifications of the correct add-on modules, the TIA Portal V14 configuration procedure, and the protocol choices (Modbus RTU, USS, Freeport) available once the physical interface is in place.
Prerequisites
- CPU 1217C DC/DC/DC (6ES7217-1AG40-0XB0) or CPU 1217C DC/DC/RLY (6ES7217-1AG50-0XB0) with firmware V4.0 or later. TIA Portal V14 supports the 1217C from V4.0 firmware; later firmware is configured with V14 SP1 or V15.1+.
- One slot on the left of the CPU for a CM 1241, or one signal-board slot under the CPU's top cover for a CB 1241.
- TIA Portal V14 (or V14 SP1 / V15 / V15.1 / V16 / V17) installed with the S7-1200 HSP matching the CPU firmware.
- 24 V DC supply on the CPU's L+ / M terminals.
- Shielded twisted-pair cable rated for RS-485 (e.g., Belden 3106A or Lapp ETHERLINE 2x2x0.34), 120 Ω termination resistors at the two bus ends, and the target slave device with its pin-out diagram.
Why the Onboard Differential Inputs Are Not an RS-485 Port
The S7-1217C's 14 onboard digital inputs (I0.0 through I1.5) include eight channels that the S7-1200 System Manual designates as differential. The term differential in this context means that each input pair (for example I0.0 and I0.1, I0.2 and I0.3, I0.4 and I0.5, I0.6 and I0.7) is wired to an RS-422-style differential receiver so that 24 V DC encoders (incremental, SSI, or PWM) with differential A/A̅ and B/B̅ outputs can be connected directly. The same is true of the pulse-generator outputs on the 1217C's transistor DC outputs, which can be configured as differential line-driver pairs.
These differential I/O channels are not, however, EIA-485 compliant in three critical ways:
- Direction: the 1217C's differential digital inputs are receivers only. RS-485 is a half-duplex bus that requires the master to drive the bus when transmitting and release it (high-impedance) when receiving. The CPU has no way to tri-state the digital input pins.
- Voltage threshold: the S7-1200 digital inputs use Type 1 / Type 3 thresholds of the IEC 61131-2 standard (0 to 5 V = OFF, 11 to 30 V = ON for 24 V DC variants). RS-485 specifies a differential voltage of ±200 mV as the receiver sensitivity and a driver output of at least ±1.5 V across 32 unit loads. The 24 V thresholds will saturate an RS-485 transceiver and prevent any meaningful decoding.
- Protocol: the input channels are sampled at the CPU's I/O update rate, debounced by the input filter, and exposed as boolean tags. There is no UART, no baud-rate generator, and no framing logic; you cannot treat a boolean tag as a serial bit stream without writing custom code at microsecond resolution, and even then you cannot drive the bus.
Siemens explicitly addresses this in the S7-1200 System Manual: the onboard differential inputs are intended for 24 V encoders, and serial RS-485 communication must be added through CM 1241 or CB 1241. See the S7-1200 Programmable Controller System Manual (entry ID 109741593) and the S7-1200 Function Manual - Communication (entry ID 109751706) for the canonical references.
S7-1200 RS-485 Hardware Options
| Module | Order Number (MLFB) | Form Factor | Ports | Standards | Max Baud | Termination |
|---|---|---|---|---|---|---|
| CB 1241 RS-485 | 6ES7241-1CH30-1XB0 | Signal board (under CPU) | 1 × RS-485 half-duplex (2-wire) | EIA-485 | 115.2 kbps | Internal 120 Ω, software-selectable from firmware V2.0 onward |
| CM 1241 RS-422/485 | 6ES7241-1CH32-0XB0 | Communication module (left of CPU) | 1 × RS-422 (4-wire full-duplex) or RS-485 (2-wire half-duplex), 9-pin D-sub female | EIA-422 / EIA-485 | 1.5 Mbps | Internal 120 Ω, software-selectable; bias resistors also selectable |
| CM 1241 RS-232 | 6ES7241-1AH32-0XB0 | Communication module | 1 × RS-232, 9-pin D-sub female | EIA-232 | 115.2 kbps | n/a |
The CB 1241 is the lowest-cost option and the right choice when you need a single RS-485 bus for a Modbus RTU slave or master, a USS drive link, or a simple Freeport application. The CM 1241 is required when you need higher baud rates (for example, for high-speed Modbus on multi-drop VFDs), need RS-422 full-duplex for a point-to-point link to a sensor, or have already used the signal-board slot for a battery board or an analog SB.
CB 1241 RS-485 Pinout
The signal board uses a removable 3-pin terminal block (T+ / T- / Shield). T+ is the non-inverting line, T- is the inverting line, and the shield terminal connects to the cable shield and should be terminated to earth ground at one point only. The board is powered by the CPU's internal 5 V rail through the SB connector, so no external power is required.
CM 1241 RS-422/485 Pinout (9-pin D-sub female)
| Pin | RS-485 2-Wire | RS-422 4-Wire |
|---|---|---|
| 1 | Shield / ground | Shield / ground |
| 2 | n.c. | TX- (T/R-) |
| 3 | Data- (T/R-) | RX- (R-) |
| 4 | n.c. | n.c. |
| 5 | Reference ground (5 V) | Reference ground (5 V) |
| 6 | n.c. | TX+ (T+) |
| 7 | n.c. | RX+ (R+) |
| 8 | Data+ (T/R+) | n.c. |
| 9 | n.c. | n.c. |
Configure the port mode (RS-485 half-duplex vs. RS-422 full-duplex), the 120 Ω termination, and the fail-safe bias resistors in the device configuration; do not fit external resistors if you have already enabled the internal ones. See the S7-1200 Communication Function Manual for the failure-mode and bias-resistor discussion.
RS-485 Electrical and Topology Constraints
RS-485 is a balanced differential bus defined by TIA-485 (formerly EIA-485). The relevant electrical limits for a 1217C system are:
- Drivers: up to 32 unit loads on a single bus; a 1217C driving through a CM 1241 counts as one unit load.
- Common-mode voltage: -7 V to +12 V across the bus.
- Termination: 120 Ω between T+ and T- at the two physical ends of the bus only. With internal termination, place the modules at the ends; otherwise fit an external 120 Ω resistor.
- Bias: a fail-safe bias network (typically 680 Ω to +5 V on T+ and 680 Ω to GND on T-) holds the line at a defined idle state when no driver is active. The CM 1241 has selectable bias; the CB 1241 has selectable bias from firmware V2.0.
- Cable: shielded twisted pair, characteristic impedance 100 to 120 Ω, capacitance < 50 pF/m, total length up to 1200 m at 100 kbps (the TI RS-485 Basics Series (SLLA545) shows the baud-vs.-distance curve). For Modbus RTU at 19 200 baud, the practical limit on industrial plants is 500 to 800 m.
- Topology: daisy-chain, never star. Stub length should be kept under 1/10 of the unit interval (a stub of 30 cm is acceptable up to 115.2 kbps).
For background on the differential-signaling principle, see Analog Devices AN-960, RS-485/RS-422 Circuit Implementation Guide and the TI SLLA545 RS-485 Basics Series.
TIA Portal V14 Configuration Procedure
- Add the module to the device configuration. Open the project, expand Devices & Networks, double-click the 1217C, and select the Device view. Drag CB 1241 (RS-485) from the hardware catalog (path: PLC > SIMATIC S7-1200 > Communication modules > CB) onto the SB slot of the CPU, or drag CM 1241 (RS-422/485) onto a free slot to the left of the CPU. The slot will only accept the matching module family.
-
Configure the port. Select the module in the device view and open Properties > RS-422/485 interface (or RS-485 interface on the CB). Set:
- Port mode: 2-wire RS-485 (half-duplex) unless the slave uses 4-wire RS-422.
- Baud rate: 9 600, 19 200, 38 400, 57 600, or 115 200 bps depending on protocol.
- Parity: even (Modbus RTU standard) or none (USS).
- Data bits / stop bits: 8 / 1 for Modbus RTU, 8 / 1 or 8 / 2 for USS.
- Flow control: usually none for RS-485 half-duplex.
- Termination: enable the 120 Ω terminator if the module is at one end of the bus.
- Bias resistors: enable on the master and on at least one node (only on the CM 1241).
-
Assign the protocol. In the same Properties tab choose one of:
- Freeport (user-controlled): the application program uses the Send_Config, Receive_Config, Send_P2P, and Receive_P2P instructions from the Communication palette.
- Modbus RTU master: uses the MB_MASTER / MB_COMM_LOAD instruction pair from the S7-1200 Modbus library.
- Modbus RTU slave: uses MB_SLAVE / MB_COMM_LOAD.
- USS: uses the USS_PORT, USS_DRIVE, and USS_READ_PARAM instructions from the USS library (drives such as SINAMICS V20, G120, G120C).
- Wire the cable. Connect T+ to T+, T- to T- across every node. Tie shields together at each junction box and ground at one end only. Verify polarity with a multimeter: T+ should read positive (1.5 V to 5 V differential) when idle if bias is enabled.
- Compile and download. Translate the project (Ctrl+B) and download the hardware configuration to the CPU. After download, the module is ready and the protocol instructions can be called from an OB (typically OB1 or a cyclic OB).
Sample Program: Modbus RTU Master Reading a Holding Register
The following Structured Text (S7-1200, TIA Portal V14) shows a typical Modbus RTU master block that reads two holding registers from slave address 1 on the CM 1241 at slot 1. Use it as a starting point and adapt to your slave's register map.
// OB1 - Cyclic Modbus RTU poll every 200 ms
// First scan: configure the port
IF "FirstScan" THEN
"MB_CommLoad_DB".REQ := TRUE; // trigger once
"MB_CommLoad_DB".PORT := 1; // logical port = CM 1241 in slot 1
"MB_CommLoad_DB".BAUD := 19200; // 19200 bps
"MB_CommLoad_DB".PARITY := 1; // 0=none, 1=even, 2=odd
"MB_CommLoad_DB".FLOW_CTRL := 0; // no flow control
"MB_CommLoad_DB".RTS_ON_DLY := 0;
"MB_CommLoad_DB".RTS_OFF_DLY := 0;
"MB_CommLoad_DB".RESP_TO := 1000; // 1 s response timeout
"FirstScan" := FALSE;
END_IF;
// Cyclic read of holding registers 40001..40002 from slave 1
"MB_Master_DB".REQ := TRUE;
"MB_Master_DB".MB_MODE := 0; // 0 = read, 1 = write
"MB_Master_DB".SLAVE := 1; // Modbus slave address
"MB_Master_DB".READ := 2; // number of registers to read
"MB_Master_DB".ADDR := 40001; // starting address (40001-based)
"MB_Master_DB".DATA_PTR := "HoldingRegs"; // points to array[0..1] of WORD
// MB_Master_DB.DONE, ERROR, STATUS give diagnostic feedback
IF "MB_Master_DB".DONE THEN
// Process HoldingRegs[0] and HoldingRegs[1] here
END_IF;
IF "MB_Master_DB".ERROR THEN
// Slave did not reply or framing error - inspect STATUS
// Common values: 16#81 = parity/framing, 16#82 = timeout, 16#86 = bad slave
END_IF;
The corresponding MB_COMM_LOAD instruction must be executed once on cold restart; after that, calling MB_MASTER on each cycle drives the bus. Refer to the S7-1200 Communication Function Manual for the full instruction reference and the Modbus master/slave chapter of the same manual for the response-timeout behavior.
Sample Program: USS Drive Control for a SINAMICS V20
// USS_PORT - configures and arbitrates the bus
// Use a cycle time of 50 ms minimum for 9 600 baud and 4 drives
"USS_Port_DB".PORT := 1;
"USS_Port_DB".BAUD := 9600;
"USS_Port_DB".ERROR := ;
"USS_Port_DB".DONE := ;
"USS_Port_DB".STATUS := ;
// USS_DRIVE - one block per drive
"USS_Drive_1".DRIVE := 1; // drive address 1..16
"USS_Drive_1".RUN := "Start_Cmd";
"USS_Drive_1".SPEED_SP := REAL_TO_INT("Speed_SP_Pct");
"USS_Drive_1".N_ACT := ; // actual speed in %
"USS_Drive_1".STATUS := ;
"USS_Drive_1".ERROR := ;
USS is a single-master, multi-drop protocol with addresses 0 to 31. Drive 0 is typically the broadcast (write-only) address used for synchronized start/stop. The SINAMICS V20 manual, the G120 field manual, and the USS protocol chapter of the S7-1200 Communication Function Manual document the exact telegram layout. Use the on-the-wire verification at the bottom of this article to confirm telegram integrity before driving a real motor.
Verification and Diagnostics
- Online & Diagnostics. In TIA Portal, mark the CM 1241 or CB 1241 in the device view and choose Online & diagnostics > Diagnostics. The status pane reports the port state (operating / not operating / fault), the baud rate actually in use, and the last protocol error code.
- LED indicators. The CM 1241 has a TxD and RxD LED that flash on every byte. If TxD lights but RxD never does, the master is transmitting but the slave is not responding. If neither lights, the bus is silent - check termination, bias, and that MB_COMM_LOAD has been called once.
- On-the-wire check. Connect a USB-to-RS-485 adapter (FTDI USB-RS485-WE-1800-BT or equivalent) in parallel with the CM 1241, run a Modbus RTU capture tool (e.g., Modbus Poll, QModMaster, or Wireshark with the Modbus dissector), and verify the request from the CPU and the response from the slave. A common field find is that A and B lines are swapped (slave silently ignores the request).
- Loopback test. For Freeport, place a jumper between T+ and T- on the field side of the cable. Anything you Send_P2P should come back to Receive_P2P. If the loopback passes but the real slave does not respond, the problem is in the slave or its wiring.
- Status word. MB_MASTER.STATUS and USS_PORT.STATUS return detailed error codes; consult the Communication Function Manual's protocol-error table to map the code to the cause.
Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| TxD LED on, RxD LED off; slave never responds | A/B polarity swapped at slave; or wrong slave address; or 120 Ω terminator not fitted / double-fitted | Reverse A and B at the slave; verify slave address in MB_MASTER.SLAVE; measure > 60 Ω between A and B with power off |
| Intermittent framing errors (Modbus status 16#8181 / 16#81) | Bias not enabled on master; termination only at one end | Enable bias resistors in the CM 1241 device configuration; add 120 Ω at both bus ends |
| Communication works briefly, then STATUS = 16#82 timeout | Total cable length > 1200 m, or excessive stubs; or baud rate too high for the cable | Reduce baud rate, shorten stubs, replace daisy-chain wiring with proper trunk topology |
| No TxD activity at all | MB_COMM_LOAD not executed on startup, or wrong logical port number | Add MB_COMM_LOAD call to OB100 / OB1; verify PORT matches the slot (1 for first CM 1241, 2 for second) |
| Garbled data, parity errors only at high baud | Common-mode voltage > ±7 V due to ground potential difference | Install RS-485 isolators (e.g., Phoenix Contact MINI MCR-2-UNI-UI-2UI) at panel boundaries; tie shield ground at one point |
| Onboard DI used as RS-485: input toggles randomly | Mis-application: HSC input is not a UART | Stop using the digital input for serial data; install a CM 1241 or CB 1241 instead |
| Modbus master returns 16#86 illegal slave response | Slave rejects the request because the address range or function code is not supported | Check the slave's register map; some slaves use 0-based addressing (0 to 65535) instead of 40001-based |
Field-Proven Tips
- Enable termination and bias in the device configuration, not externally. The CM 1241's internal resistors are designed to fail-safe voltages for the bus; adding external 120 Ω in parallel will load the bus to 60 Ω and cause overcurrent on some drivers.
- Use the lowest baud rate the slave supports. On a noisy plant floor, 9 600 bps is often more reliable than 115 200 bps even though the theoretical distance is shorter.
- Keep the CPU firmware current. Siemens shipped a Modbus master bug fix in firmware V4.2.1 that affected response timeouts on long frames; V4.4+ has the long-standing MB_COMM_LOAD background OB behavior documented in the Communication Function Manual.
- Reserve the signal-board slot for the CB 1241 if the project is space-constrained. The SB adds 25 mm to the CPU height but does not consume a slot on the DIN rail.
- Document the bus topology. A one-line drawing of every node, its address, its cable length, and the location of the 120 Ω terminators saves hours during commissioning.
- If the application is Freeport, configure the input filter on the receive pin to 0.8 ms or less for baud rates at or above 9 600 bps. The default 6.4 ms filter will mask the start bit of every byte and break the link.
Summary
The S7-1217C does not have an onboard RS-485 communication port. Its differential digital inputs are receivers for 24 V encoders and cannot act as a UART. To add RS-485 to a 1217C, install a CB 1241 RS-485 (signal board) or a CM 1241 RS-422/485 (communication module), configure the port in TIA Portal V14, choose a protocol (Modbus RTU, USS, or Freeport), and follow RS-485 wiring rules: daisy-chain topology, 120 Ω termination at both ends, bias at the master, and shielded twisted-pair cable. With those pieces in place, the 1217C will communicate reliably with up to 31 slaves over distances up to 1 200 m.
Does the S7-1217C have an onboard RS-485 port?
No. The CPU ships with two PROFINET ports only. RS-485 must be added through a CB 1241 RS-485 signal board (6ES7241-1CH30-1XB0) or a CM 1241 RS-422/485 communication module (6ES7241-1CH32-0XB0).
Can I use the onboard differential digital inputs (I0.0 through I0.7) as an RS-485 receiver?
No. Those inputs are 24 V DC type 1 / type 3 IEC 61131-2 receivers designed for encoders. They have no tri-state driver, no UART, and no protocol support. Wire a CM 1241 or CB 1241 instead.
Which module should I choose - CB 1241 or CM 1241?
Use the CB 1241 RS-485 (115.2 kbps) for a single Modbus RTU or USS bus on a compact machine. Use the CM 1241 RS-422/485 (1.5 Mbps) when you need higher speed, RS-422 full-duplex, or have already used the SB slot for a battery or analog board.
How do I enable 120 Ω termination and fail-safe bias in TIA Portal V14?
Select the CM 1241 / CB 1241 in the device view, open Properties > RS-422/485 interface, and tick the Termination and Bias checkboxes. No external resistor is required.
What is the maximum number of RS-485 slaves on a 1217C?
RS-485 supports up to 32 unit loads. Each standard slave counts as one unit load; the 1217C's CM 1241 counts as one. In practice you can connect 31 slaves at baud rates up to 115 200 bps with a bus length up to 1 200 m at low baud.
Why does my Modbus master return STATUS = 16#82 after a few seconds?
STATUS 16#82 means response timeout - the slave did not reply. Common causes are A/B polarity swap, missing 120 Ω termination, baud rate mismatch, or an unsupported function code. Verify with a USB-to-RS-485 capture on the same bus.