1. Problem Overview: CP341 Modbus Master/Slave Error 1E0F
A SIMATIC S7-300 / S7-400 station using a CP341 point-to-point module with the Modbus Master/Slave library occasionally fails to bring the link up. The most common symptom reported in field service is the P_SND_RK_WORK_STATUS word of the FB7 Modbus master cycling between 0 and 7695 (hex 16#1E0F) every scan, with ERROR = 1. The TX LED never blinks, the RX LED never latches into the active state, and the slave never sees a valid request frame.
Error 1E0F is the Modbus master library's "parameter error in the send/receive function" indicator. It does not describe a Modbus protocol fault; it describes an internal disagreement between FB7 (MODBUS master), the underlying FC81 (P_SND_RK) send block, and the data buffer / parameter block they reference. In almost every CP341 service case the actual fault is one of three root causes:
- The send block was wired with
R_TYP = D(data block) when the Modbus library expectsR_TXP = X(no separate data block needed for some transfer modes) or vice-versa, withR_NOpointing to an empty / wrong DB. - The CP341 was parameterized for RS422 4-wire full-duplex while the physical cable is RS485 2-wire half-duplex (or the parameterization tool left the interface in an incompatible mode).
- The application attempts to move > 256 bytes per Modbus transaction, exceeding the RTU maximum PDU size.
2. CP341 Hardware Variants and Modbus License
The CP341 is available in three interface variants. The Modbus Master/Slave library runs only on the RS485/422 variants and requires a separate license dongle (or activated license key on newer firmware).
| MLFB / Order Number | Interface | Max Baud | Modbus Library |
|---|---|---|---|
| 6ES7341-1AH02-0AE0 | RS232C (V.24) | 38.4 kbit/s | ASCII / 3964(R) only |
| 6ES7341-1BH02-0AE0 | RS422 / RS485 (X27) | 115.2 kbit/s | Modbus RTU + ASCII |
| 6ES7341-1CH02-0AE0 | RS422 / RS485 (X27) | 115.2 kbit/s | Modbus RTU + ASCII |
| 6ES7870-1AA01-0YA0 | Modbus Master/Slave library, single license | - | Software |
| 6ES7870-1AB01-0YA0 | Modbus Master/Slave library, copy license (15 stations) | - | Software |
Confirm the loaded module type in HW Config matches the physical card. A V.24 (RS232) CP341 can be mis-flagged as the 422/485 variant if the rack was rebuilt. The Modbus library refuses to load against an 1AH02 because the underlying point-to-point driver is 3964(R) ASCII-only.
3. Modbus Library Block Architecture (FB7 / FB80 / FC81 / FC82)
The Modbus Master/Slave library consists of two control FBs, two protocol FBs, and two I/O FBs. They are normally called from OB1 or a cyclic interrupt OB on the S7-300 / S7-400 CPU.
| Block | Name | Role | Called By |
|---|---|---|---|
| FB7 |
P_MASTER / MODBUS master |
Builds request frames, dispatches to FC81 | OB1 (cyclic) |
| FB80 |
P_SLAVE / MODBUS slave |
Parses requests, builds responses, dispatches to FC81 | OB1 (cyclic) |
| FC81 | P_SND_RK |
Send frame to CP341 via SFB | FB7 / FB80 |
| FC82 | P_RCV_RK |
Receive frame from CP341 via SFB | FB7 / FB80 |
| SFB9 |
BSEND / PUT variant |
Used by older libraries | Internal to CP341 driver |
The send and receive FBs both expose a P_SND_RK_WORK_STATUS (a WORD) and an ERROR (a BOOL). On success, WORK_STATUS = 0 and ERROR = 0. The instant WORK_STATUS shows a non-zero value and ERROR is high, the send request was rejected before it reached the CP341.
Typical master call skeleton in OB1:
// Network 3 - copy request data into Modbus send DB
L DB_REQ.Number_Of_Registers
T DB_MODBUS.REQ_LEN
CALL FB 7, DB_MODBUS_MASTER // MODBUS master
LADDR := 256 // logical CP341 address
DB_NO := 100 // Modbus data DB
...
// Network 4 - send
CALL FC 81, DB_SND // P_SND_RK
R_TYP := 'D' // <-- WRONG - see section 5
R_NO := // <-- empty
...
// Network 5 - receive
CALL FC 82, DB_RCV // P_RCV_RK
...
4. Decoding Error 1E0F (7695) in P_SND_RK_WORK_STATUS
The P_SND_RK_WORK_STATUS word is not a CP341 driver error - it is the Modbus library's interpretation of the lower CP status. The relevant codes for error 1E0F:
| Hex | Decimal | Meaning in P_SND_RK_WORK_STATUS |
|---|---|---|
| 16#1E08 | 7688 | Send DB not present or wrong length |
| 16#1E09 | 7689 | Send buffer currently in use by previous job |
| 16#1E0A | 7690 | CP341 not in RUN / not ready |
| 16#1E0C | 7692 | Wrong LADDR for CP341 instance |
| 16#1E0F | 7695 | Parameter error in R_TYP / R_TXP / R_NO |
| 16#1E10 | 7696 | CP341 driver initialization failed |
| 16#1E12 | 7698 | CP341 hardware fault (diagnostic interrupt pending) |
The diagnosis path that almost always applies to a cycling 1E0F is to read the raw SFC status from P_SND_RK_DATA.SFCSTATUS inside the instance DB of FC81. That value, regardless of the wrapper's WORK_STATUS, points at the underlying CP341 driver fault (resource allocation, wrong protocol class, or hardware diagnostic).
5. R_TYP versus R_TXP Parameter Mismatch
The single most common reason for a CP341 Modbus master to cycle on 1E0F is wiring the FC81 call incorrectly. The send block has the following relevant formal parameters:
| Parameter | Type | Meaning |
|---|---|---|
R_TYP |
CHAR | Source type: 'D' = data block, 'E' = input, 'A' = output, 'M' = flag |
R_NO |
INT | DB / byte offset source number |
R_TXP |
BOOL | If TRUE, do not send a separate data block; data is already in the FB instance |
R_LEN |
INT | Length of the data to send |
DB_NO |
INT | Number of the DB the FC81 writes the received frame into |
The combination R_TYP = D + R_NO = empty is logically incoherent: the library is told "the data is in a data block" but is not told which one. The library rejects the job and sets WORK_STATUS = 1E0F. The fix is to use R_TXP = TRUE when the Modbus library has already placed the frame in its instance DB and R_NO must be left blank, or to use R_TYP = 'D' with a valid R_NO.
Correct call for Modbus master / slave (the application holds the request in the FB instance):
CALL FC 81, DB_SND // P_SND_RK
R_TYP := // leave blank
R_TXP := TRUE // data is in FB instance
R_NO := // leave blank
LADDR := 256 // CP341 logical address
DB_NO := 100 // receive DB
DBNO := 100 // redundant alias
LEN := W#16#0 // length taken from FB
RCV_TYP := 'D'
Correct call when the application owns a separate request DB:
CALL FC 81, DB_SND
R_TYP := 'D' // data source = DB
R_TXP := FALSE
R_NO := 110 // request DB number
LADDR := 256
DB_NO := 100 // receive DB
DBNO := 100
LEN := 16 // explicit length
RCV_TYP := 'D'
Mixing both modes produces 1E0F on the first send call.
6. RS422 4-Wire vs RS485 2-Wire Configuration
CP341 hardware variant 1BH02 and 1CH02 exposes an X27 front connector with the following relevant pins:
| X27 Pin | RS422 (4-wire) | RS485 (2-wire) |
|---|---|---|
| 11 | T (A) - transmit + | A - bus + |
| 14 | T (B) - transmit - | B - bus - |
| 9 | R (A) - receive + | (unused) |
| 12 | R (B) - receive - | (unused) |
| 8 | GND | GND |
| 15 | +5V via bias | +5V via bias |
The CP341 parameterization tool (started from HW Config by right-clicking the CP341 -> "Object Properties" -> "Parameter Assignment" tab, or from the standalone "PTP Param" tool on the engineering station) has a radio button labelled "Interface" with two choices: RS422 (4-wire full-duplex) or RS485 (2-wire half-duplex). This selection is downloaded to the CP341 at STOP-to-RUN transition and is not editable online.
If the parameterization tool is set to RS422 and the bus is wired as 2-wire, the receiver's idle-state biasing network is wrong, the CP341 never sees a valid differential voltage on R(A)/R(B), and the RX LED stays dark. The send path still tries to drive T(A)/T(B), but because the parameterization does not match the cable the bus is electrically idle and the Modbus library aborts with 1E0F after one inter-frame timeout. The cable selected for Modbus must therefore be RS485 2-wire, with the parameterization tool set to the same.
7. Modbus Frame Size Limits (256-Byte Maximum PDU)
Modbus Application Protocol Specification v1.1b3 limits the Protocol Data Unit (PDU) to 253 bytes of payload. Adding the 1-byte slave address and the 2-byte CRC16 produces a maximum RTU frame of 256 bytes on the wire. The CP341 Modbus library enforces this on the master side and rejects any send request whose total length exceeds 253 bytes with status 1E0F on P_SND_RK_WORK_STATUS.
Attempting to send 400 bytes of register data - which a field application may reasonably do when reading a 200-register block - requires splitting into multiple FC03 (Read Holding Registers) or FC04 (Read Input Registers) requests, each ≤ 125 registers per Modbus convention. The Modbus master library has a parameter REQ_LEN at the request DB that must be set to the register count, not to the byte count. The library translates that count internally:
// Per-request register limit (Modbus spec, FC03/FC04):
REQ_LEN := 125 // maximum registers per transaction
// Per-request byte limit:
BYTES := 250 // 125 regs * 2 bytes
// PDU size:
PDU := 1 (FC) + 1 (start addr hi) + 1 (start addr lo)
+ 1 (qty hi) + 1 (qty lo)
+ N * 2 // payload for FC03 / FC04
// Total RTU frame size:
FRAME := 1 (addr) + PDU + 2 (CRC) = 256 bytes max
When the application tries to dispatch a 400-byte single request, the master library raises 1E0F before the data is loaded into the CP341, which is exactly the observed behaviour.
Recommended workaround for large block reads is to issue a loop of up-to-125-register reads from the user program and concatenate them into the application DB. The CP341 can then handle each transaction inside the 256-byte limit.
8. Retrieving SFCSTATUS from P_SND_RK_DATA
The Modbus library does not pass the raw CP341 status code up through WORK_STATUS when the parameter stage fails. To get the underlying driver fault, open the instance DB of FC81 in STEP 7 / TIA and inspect the following UDT members:
| UDT Member | Type | Meaning |
|---|---|---|
P_SND_RK_DATA.SFCSTATUS |
WORD | Raw status of the underlying SFB (e.g. 0001 = internal error, 001F = parameter error) |
P_SND_RK_DATA.SFCERROR |
BOOL | Internal SFB error flag |
P_SND_RK_DATA.RCV_COUNT |
DINT | Number of bytes actually received on previous transaction |
P_SND_RK_DATA.XMT_COUNT |
DINT | Number of bytes actually transmitted |
P_SND_RK_DATA.PRTCL_ERR |
BYTE | Modbus protocol error from slave |
A typical SFCSTATUS dump after a 1E0F error reveals:
-
0001- length parameter ≤ 0: confirmsR_LENorR_NOnot properly populated. -
0008- resource allocation failure: confirm CP341 is in RUN and the LADDR matches the slot. -
001F- interface-specific driver error: look at CP341 diagnostic buffer.
Add a VAT or watch table that reads P_SND_RK_DATA.SFCSTATUS every cycle while troubleshooting; do not rely on WORK_STATUS alone.
9. RS485 Idle State Biasing and Cable Recommendations
RS485 receivers require the bus to be in a defined idle (mark) state when no driver is active. The convention is:
-
R(A)/Data+(CP341 pin 11) idle voltage = 0 V (relative to bus ground) -
R(B)/Data-(CP341 pin 14) idle voltage = +5 V (relative to bus ground) - Equivalent differential:
V(A) - V(B) = -5 V= logical "1" / idle
If the cable has no fail-safe bias (i.e. the bus floats), the CP341 RX line latches into indeterminate logic, the RX LED never lights, and the Modbus library's inter-frame timer expires. The result is again a 1E0F on the next send.
Recommended cable plant:
- Twisted pair, characteristic impedance 120 ohm, e.g. Belden 3106A or Lapp UNITRONIC BUS LD.
- Terminating resistor 120 ohm between A and B at each end of the segment only (master + farthest slave).
- Bias resistors: 680 ohm pull-up from +5V to B and 680 ohm pull-down from A to GND at one point on the bus (typically the master).
- Shield grounded at one end only.
- Maximum stub length ≤ 0.3 m from tap to device.
10. TX / RX LED Diagnostic Behavior
The two LEDs on the front of the CP341 (labelled "TXD" and "RXD") are essential first-line diagnostics:
| LED | Expected Behavior | What It Indicates |
|---|---|---|
| TXD blinking | Each outgoing Modbus request frame | FC81 / P_SND_RK has accepted the job and the CP341 is driving the bus |
| TXD dark, status 1E0F | No transmission attempted | Parameter / DB mismatch - fix R_TYP / R_TXP / R_NO first |
| RXD blinking | Each successful frame received | RS485 electrical connection is good; bias and termination are correct |
| RXD dark | No reception, no reply | Bus bias / termination / wiring fault - check X27 wiring against parameterization tool |
| Both LEDs dark, status 1E0F | No activity at all | Most likely R_TYP / R_TXP / R_NO mismatch or wrong LADDR |
| TXD + RXD both flashing rapidly | Noisy bus, possible echo | Missing terminating resistors or wrong topology |
1E0F confirms the problem is on the physical / parameter side, not the protocol side.
11. Step-by-Step Troubleshooting Procedure
- Place the CPU in STOP and verify the CP341 module type. In HW Config, confirm slot address and MLFB match the physical card. Wrong MLFB ("CP341 RS232" loaded where "CP341 RS485/422" is installed) is the most overlooked root cause.
- Open the CP341 parameterization tool. Select Interface = RS485 (2-wire). Click "Protocol" -> "Modbus Master" or "Modbus Slave". Save and download to the CP341.
- Inspect the CP341 diagnostic buffer. STEP 7 -> PLC -> Module Information -> Diagnostic Buffer. Entries such as "Parameter assignment error", "Wrong interface parameterization", or "Interface fault" pinpoint configuration issues.
-
Audit the FB7 (master) or FB80 (slave) call. Verify
LADDR,DB_NO, and request DB length. Confirm request DB exists and is the correct length. -
Audit the FC81 (P_SND_RK) call. Confirm the combination is one of:
-
R_TXP = TRUE,R_TYPandR_NOblank, OR -
R_TXP = FALSE,R_TYP = 'D',R_NO = <valid DB number>
-
-
Check the requested transaction size. If
REQ_LEN> 125 (registers) or implied byte length > 253, split into multiple transactions. - Wire the RS485 bus per the table in section 6. Use only X27 pins 11 and 14. Add terminating 120 ohm resistors at both ends. Add the bias network at the master.
-
Power the station and observe TX/RX LEDs. In RUN, the TX LED must blink on each request. If TX remains dark with
WORK_STATUS = 0, the application is not callingFB7or it is gated by a missing handshake. -
Read
P_SND_RK_DATA.SFCSTATUSon the next error and translate the code per section 8. - Use a Modbus scanner (e.g. a PC with pymodbus or CAS Modbus Scanner) on the same segment. If the scanner can talk to the slave but the CP341 cannot, the problem is between the CP341 and the bus, not the Modbus slave. If the scanner also fails, the problem is the slave.
12. Verification Checklist
Once the corrections are made, the following must all be true:
- CP341 diagnostic buffer reports no new entries after 5 minutes of cyclic Modbus traffic.
- TX LED blinks on every request from the application.
- RX LED blinks on every slave reply.
-
P_SND_RK_WORK_STATUS = 0andERROR = 0during normal operation. -
P_SND_RK_DATA.SFCSTATUS = 0during normal operation. -
P_RCV_RK.RCV_COUNTincrements by the expected length of each slave reply. - Slave-side
FB80reportsREQ_COUNTincrementing, noPRTCL_ERRset. - Application read values are coherent with the actual slave data.
- Cyclic re-run for 1 hour produces zero error toggles in
P_SND_RK_WORK_STATUS.
FAQ
What does Modbus master error 1E0F (7695) actually mean on a Siemens CP341?
1E0F is the Modbus master library's "parameter error in the send/receive function". It is triggered before the request reaches the CP341. The most common causes are wrong R_TYP / R_TXP / R_NO on FC81, an empty send DB, or a request length above the 253-byte Modbus PDU limit. Read P_SND_RK_DATA.SFCSTATUS in the FC81 instance DB for the underlying driver code.
Should the CP341 be set to RS422 or RS485 for Modbus RTU?
Set the CP341 parameterization tool to RS485 (2-wire) for any half-duplex Modbus RTU bus. Use RS422 only for full-duplex point-to-point links with separate transmit and receive pairs. Mixing them produces a dark RX LED and 1E0F send errors even though the protocol parameters are otherwise correct.
What is the maximum payload per Modbus RTU request on CP341?
253 bytes of PDU payload, 256 bytes total RTU frame. For function codes 03 / 04 / 06 / 16 this corresponds to 125 registers per request (250 bytes of register data) as the practical application limit. Larger block reads must be split into multiple FC03 transactions.
Why is my RX LED never lighting even though the slave responds on a PC scanner?
The RX LED only confirms electrical connection, not protocol. If a PC scanner can read the slave but the CP341 cannot, the bus bias or termination is wrong, the cable is wired for 4-wire while the CP341 is set to 2-wire, or X27 pins 9 and 12 are incorrectly tied to 11 and 14. Verify each end has a 120 ohm terminator and that a single bias network is installed at the master end.
Can I use the same FC81 (P_SND_RK) block for both master and slave?
Yes, but each role needs its own instance DB and its own correct parameter set. The master uses FB7, the slave uses FB80. Both internally call FC81 / FC82. A common mistake is to copy FB7's send-call into the slave project and leave R_TYP = 'D' with an empty R_NO - that combination is rejected with 1E0F on the first slave response.