How to Fix Modbus RTU Error 16#8281 on Siemens S7-1200
When programming a Modbus RTU polling sequence in Siemens TIA Portal, the MB_MASTER block will occasionally drop a transmission, pull the ERROR bit high, and output a 16#8281 hex code at the STATUS pin.
Block: MB_MASTER (FB 43) REQ: TRUE DONE: FALSE ERROR: TRUE STATUS: 16#8281 Description: Port Busy / Write Rejected. The communication module is currently processing an active request and cannot accept a new one.
Unlike 16#80C8 (which indicates a missing response from the slave), 16#8281 is an internal PLC execution error. It means your ladder logic is firing the REQ (Request) execution pin too fast, attempting to send a new Modbus frame while the CM 1241 serial port is still actively transmitting or waiting for a previous response.
Step 1: Stop Using Clock Memory Bytes
The most common mistake when integrating Modbus devices is linking a system clock pulse (e.g., Clock_10Hz or a %M0.5 flashing bit) directly to the REQ input of the MB_MASTER block.
Serial communication is not deterministic. A Modbus read request might take 30ms to come back, or 150ms with line noise. If you pulse the REQ pin every 100ms using a fixed clock, but the last cycle was 150ms, the PLC will try to overwrite the active process and get the 16#8281 Port Busy fault immediately.
Step 2: Build an Interlocking State Machine
Your ladder logic must be strictly sequential (interlocked state machine) to fix this. Only fire the next request when the current request has a definitive completion signal.
- Use Feedback Signals: Utilize the
DONE,ERROR, orSTATUSoutputs of theMB_MASTERblock to confirm the transaction has finished. - Insert an Inter-frame Delay: Do not immediately trigger the next request the exact millisecond the
DONEbit goes high. RS485 slave devices need breathing room. Use theDONE/ERRORbits to trigger a TON (On-Delay Timer) set to 30ms-50ms. - Trigger the Next Cycle: Use the
Qoutput of that timer to trigger theREQof your nextMB_MASTERblock (or loop it back to poll the next register).
Step 3: Background DB Reset
If you have corrected your ladder logic but 16#8281 remains permanently locked, the CM 1241 background instance data block (DB) may be stuck in a busy loop. To clear it without stopping the PLC:
Navigate to the Instance DB of your MB_MASTER block, locate the COM_RST (Communication Reset) bit, and manually force it to TRUE for one scan cycle. This will flush the buffer and free up the port.
Writing state machines for dozens of Modbus devices?
Managing cascading timers, error handling, and polling tokens in TIA Portal ladder logic wastes engineering hours. Valtoris Edge Gateways offload the entire Modbus RTU polling cycle to the hardware edge. The gateway handles the device timing, while your PLC reads a clean, contiguous block of data instantly via Modbus TCP.
