Problem Details: MB_Master Returns STATUS 8382 on a Single-Bit Write
A PLC engineer attempts to communicate with an Ingersoll Rand compressor over Modbus RTU using the MB_Master (formerly Modbus_Master) instruction block inside Siemens TIA Portal V15.1 and newer. The target device exposes a single 16-bit holding register at address 40001 that combines control bits (writeable) and status bits (read-only). When the engineer issues a write to that whole word, the MB_Master block reports STATUS = 16#8382 (decimal 33666). The same error appears when the engineer attempts to write only one bit of the word.
The engineer needs to know:
- What the 8382 status code actually means at the Modbus protocol layer.
- Whether writing a single bit to a 16-bit holding register is legal under Modbus RTU.
- How to configure
DATA_PTRso that bit-level access works against a word-oriented register. - Which alternative Modbus function codes can target individual coils if the holding register is read-only or partially write-protected.
Root Cause Analysis: 8382 is a Slave Exception 3, Not a Local PLC Error
The MB_Master STATUS output is a 16-bit word. The high byte (bits 15-8) indicates the instruction category, and the low byte carries the specific error. Code 0x8382 is part of the cluster used by TIA Portal's online help to report that the Modbus slave returned an exception response with exception code 0x03 (ILLEGAL DATA VALUE) or — depending on the TIA version and function code used — that the response header was malformed.
Per the Modbus Application Protocol Specification V1.1b3, the four standard exception codes that the master can receive are:
| Exception Code | Name | Meaning |
|---|---|---|
| 0x01 | ILLEGAL FUNCTION | Function code not supported by the slave. |
| 0x02 | ILLEGAL DATA ADDRESS | Address in DATA_ADDR is not valid on this device. |
| 0x03 | ILLEGAL DATA VALUE | Structure of the request frame is invalid (length, value range, sub-function, etc.). |
| 0x04 | SLAVE DEVICE FAILURE | Irrecoverable error in the slave while processing the request. |
When the slave answers with exception 0x03, the master converts that into STATUS 0x8382. The conversion mapping observed in TIA Portal V15.1 Update 1 and later versions is shown below.
| Modbus Exception from Slave | MB_Master STATUS (hex) | Common Trigger |
|---|---|---|
| 0x01 ILLEGAL FUNCTION | 0x8381 | Function code not implemented in the slave firmware. |
| 0x02 ILLEGAL DATA ADDRESS | 0x8383 | Address out of range, write to read-only location, or write of only half of a 32-bit REAL spread across two registers. |
| 0x03 ILLEGAL DATA VALUE | 0x8382 (with FC 0x05 / 0x06 / 0x10) or 0x8384 / 0x8385 (with FC 0x05 / 0x08) | Length is wrong for the requested data type, the bit count is not exactly 1 for FC 0x05, or the value is out of the slave's accepted range. |
| Any code > 0x03 | 0x8384 | Generic mapping bucket for less-common exceptions. |
In some TIA Portal versions the same STATUS 0x8382 is also raised when the received response header is structurally invalid (for example, byte count mismatch in an FC 0x03 response). Always check the TIA Portal online help that ships with the specific installed version — wording is known to differ between V15.1, V16, V17 and V18.
Why a Holding Register Cannot Be Written "Bit by Bit" in Modbus
Modbus RTU defines four primary address spaces, each with a 16-bit (1 register) data granularity:
| Address Prefix | Name | Read/Write | Function Codes | Smallest Unit |
|---|---|---|---|---|
| 0xxxx | Coils (Discrete Outputs) | R/W | 0x01, 0x05, 0x0F | 1 bit (FC 0x05) |
| 1xxxx | Discrete Inputs | R | 0x02 | 1 bit |
| 3xxxx | Input Registers | R | 0x04 | 16 bits (1 register) |
| 4xxxx | Holding Registers | R/W | 0x03, 0x06, 0x10 | 16 bits (1 register) |
The wire-level write function codes for holding registers (FC 0x06 Write Single Register and FC 0x10 Write Multiple Registers) always operate on entire 16-bit words. The Modbus specification provides no primitive for "set bit 7 of register 40001" against a 4xxxx address. If a slave implements FC 0x05 Write Single Coil against address 0xxxx, that operation is bit-level; the master will not use it on 4xxxx.
This means there are only two legal ways to change a single bit that lives inside a 16-bit holding register:
- Read-Modify-Write the whole word. Issue FC 0x03 to read register 40001, modify the relevant bit in the PLC's data copy, then issue FC 0x06 (single word) or FC 0x10 (multi-word) to write the whole register back. This is the correct approach for a true 4xxxx holding register.
- Use the coil address space if the device exposes one. Some Ingersoll Rand controllers expose control bits both as holding register 40001 and as discrete coils in the 0xxxx range. If coil n mirrors bit n of 40001, the engineer can target it with FC 0x05. This avoids any read-modify-write cycle.
Configuring MB_Master for Bit-Level Work Against a Word Register
Even though Modbus does not support a native 1-bit write to a holding register, the MB_Master block can be wired so that a single bit is sent to the slave — but only by mapping that bit to a coil (0xxxx) function code, never to a holding register. For a true 4xxxx word, the engineer must implement a read-modify-write sequence inside the PLC program.
Step-by-Step: Read-Modify-Write of Register 40001
- Create a global data block (DB) named
"Compressor_IF". - Inside that DB declare
ControlStatusWord : WORD;andControlStatusWord_R : WORD;(one for write, one for read-back). - Call
MB_MasterwithMODE = 0(read),DATA_ADDR = 40001,DATA_LEN = 1,DATA_PTR := "Compressor_IF".ControlStatusWord_R. - Wait for
DONE = 1and copyControlStatusWord_RintoControlStatusWordin OB1. - Set the desired bit of
ControlStatusWordusing AT-style view on aSTRUCTofARRAY[0..15] OF BOOL, or by using bit-twiddling operators (UDWORDAND/OR). - Call
MB_Masteragain withMODE = 1(write),DATA_ADDR = 40001,DATA_LEN = 1,DATA_PTR := "Compressor_IF".ControlStatusWord. - Evaluate
STATUS. IfSTATUS = 0the write succeeded; any non-zero value is the exception code from the slave converted per the table above.
The critical detail that produces 0x8382 in practice is that an engineer is sometimes tempted to wire a BOOL tag directly to DATA_PTR while leaving DATA_ADDR at the 40001 holding register. TIA Portal accepts the syntax, but the master builds a frame that is inconsistent: the slave sees a 1-bit payload against a 16-bit register request and replies with exception 0x03 ILLEGAL DATA VALUE. The two valid ways to avoid this trap are:
- Always size
DATA_PTRto matchDATA_LEN× 2 bytes, and address a coil (0xxxx) if the payload is 1 bit. - Use a
WORDforDATA_PTRwhenDATA_ADDRtargets a 4xxxx register, regardless of whether only one bit is meaningful.
The Ingersoll Rand Case: Why the Compressor Itself Rejected the Write
The engineer who posted the original question eventually discovered that the Ingersoll Rand compressor was returning 0x8382 because the controller was not in Run state. The unit was unpowered at the controller board, so the slave's Modbus stack was alive enough to answer with an exception frame but not to apply the value. The PLC-side configuration was correct. Older revisions of the Ingersoll Rand Modbus map did not document this requirement.
This is a frequent field pattern with screw and centrifugal compressors: the controller is in Local / Off / Standby, the Modbus port is alive, but writing to the Control/Status word (40001) is rejected with exception 0x03 because the slave firmware refuses control commands when the unit is not in Remote or Remote Ready state. The right diagnostic path is therefore:
- Read the unit's mode word (typically register 40002 or 40010 depending on model) to confirm it is in Remote.
- Switch the unit to Remote via the HMI/keypad first, then retry the write.
- Re-issue the MB_Master call. STATUS should clear to 0x0000 within one scan cycle of the slave acknowledging the mode change.
Decoding TIA Portal STATUS in Real Time
When developing, the engineer should add a small evaluation block to the OB1 cycle that latches the most recent non-zero STATUS into a diagnostic word and produces a string message for the HMI. Suggested mapping:
| STATUS (hex) | HMI Text | Operator Action |
|---|---|---|
| 0x8380 | Timeout — no response from slave | Check cable, baud, parity, slave address, termination. |
| 0x8381 | Exception 0x01 — function not supported | Verify FC against device manual; some slaves do not implement FC 0x10. |
| 0x8382 | Exception 0x03 — invalid data value / length | Match DATA_PTR size to DATA_LEN, verify unit is in Remote, retry with whole-word read-modify-write. |
| 0x8383 | Exception 0x02 — illegal data address | Re-check DATA_ADDR offset, confirm 1-based vs 0-based addressing, check whether register is read-only. |
| 0x8384 | Exception > 0x03 or generic length error | See device manual for the specific exception returned. |
| 0x8385 | Exception 0x03 with FC 0x08 | Diagnostic function 0x08 frame rejected. |
Verification Procedure
- Connect a Modbus RTU sniffer (or a second master in listen-only mode) on the RS-485 trunk. Confirm the bytes on the wire match what
MB_Masterclaims to send. The address byte should be the slave ID, FC should be 0x06 or 0x10, and the register address (2 bytes, big-endian) should match the slave's documented map. - Switch the Ingersoll Rand controller to Remote via the keypad/HMI. Wait for the unit to confirm Remote state in its local display.
- Re-trigger the MB_Master write. STATUS should now return 0x0000 and DONE should rise for one cycle.
- Read the register back with FC 0x03 and confirm the bit is set. Some compressor controllers require a separate "Command Acknowledge" register to be toggled for the control change to take effect — see the unit-specific Ingersoll Rand Modbus map for the order of operations.
- Log the change in the HMI alarm archive so that any future 0x8382 can be correlated with a unit mode transition.
Troubleshooting Matrix
| Observed Symptom | Most Likely Cause | Diagnostic Step | Fix |
|---|---|---|---|
| 0x8382 on every write to 40001 | Compressor in Local/Off | Read mode register; check HMI screen | Switch unit to Remote at the panel, retry |
| 0x8382 only when writing 1 bit | DATA_PTR is BOOL but DATA_ADDR is 4xxxx | Watch DATA_PTR type in DB | Use WORD for DATA_PTR or move the bit to a coil (0xxxx) |
| 0x8383 instead of 0x8382 | Address is read-only on this slave firmware | Check device map; try FC 0x03 first | Use the coil address space if the device exposes it |
| 0x8380 | No response — wiring/baud issue | Loopback test, check termination (120 Ω), parity | Match baud (typically 9600/19200), 8E1, 120 Ω on both ends |
| 0x8382 after firmware update of slave | Register map shifted or was reassigned to read-only | Re-scan with FC 0x03; compare to latest manual | Update PLC DB to new map |
| 0x8384 with random value | Exception 0x04 SLAVE DEVICE FAILURE | Cycle power to compressor controller | Service the controller board if persistent |
Reference: TIA Portal MB_Master / MB_Client Parameter Set
| Parameter | Type | Purpose | Typical Value for Compressor Control |
|---|---|---|---|
| REQ | BOOL | Trigger edge for one transaction | Rising edge from OB1 cyclic logic |
| MB_ADDR | UINT | Modbus slave address (1..247) | 1 (verify on the controller DIP switches) |
| MODE | USINT | 0 = read, 1 = write single, 2..6 = diagnostics | 0 for read-modify, 1 for write |
| DATA_ADDR | UINT | Start address (0-based in TIA, offset 40001) | 0 → 40001, 1 → 40002 |
| DATA_LEN | UINT | Number of registers / coils | 1 for one word; 1..16 for one bit (coil) |
| DATA_PTR | VARIANT | Pointer to local data area | WORD tag for 4xxxx, BOOL tag for 0xxxx |
| DONE | BOOL | 1 cycle TRUE on success | Reset REQ on rising edge |
| BUSY | BOOL | Transaction in progress | — |
| ERROR | BOOL | 1 if STATUS <> 0 | — |
| STATUS | WORD | Error code (0x80xx cluster on failure) | Decode per table above |
The address handling in TIA Portal is a frequent source of confusion. The TIA help states that DATA_ADDR is 0-based; therefore a documented 40001 register must be entered as 0, and a 40002 register as 1. If the engineer types 40001 directly, the master shifts the request by 40001 registers, the slave answers exception 0x02 ILLEGAL DATA ADDRESS, and TIA reports STATUS 0x8383. This is a separate failure mode from 0x8382 but is often misdiagnosed as the same problem.
Alternate Approaches: MB_Client, Third-Party Masters, and Gateway Converters
If the application has many simultaneous Modbus masters or needs the same compressor served to two controllers, consider switching from MB_Master to MB_Client on a CPU with PROFINET or PROFINET/PROFIBUS — for example S7-1500 with PROFINET to a third-party gateway such as the HMS Anybus, the Phoenix Contact EWMS, or a Siemens CM PtP module. The MB_Client STATUS error codes are similar but not identical to MB_Master. Always cross-check against the TIA Portal version-specific help.
For installations where the Ingersoll Rand controller is already wired to a Building Management System over BACnet or LonWorks, the cleanest path is sometimes a Modbus-to-BACnet gateway that handles the read-modify-write logic and exposes only a single Boolean object per compressor bit. The PLC then writes that Boolean, the gateway maintains the 16-bit register, and the 0x8382 problem is contained inside the gateway.
Key Takeaways
- STATUS 0x8382 from
MB_Mastermeans the Modbus slave returned exception 0x03 ILLEGAL DATA VALUE (or, in some TIA versions, an invalid response header). The PLC bus is fine; the slave is refusing the request. - Holding registers (4xxxx) are 16-bit words. Modbus has no native 1-bit write against 4xxxx. Either use a coil (0xxxx) address that mirrors the bit, or perform a read-modify-write of the whole word.
- For the Ingersoll Rand compressor family, the most common reason for 0x8382 on register 40001 is that the unit is not in Remote. Older documentation revisions may not state this. Always confirm Remote state before treating the exception as a configuration error.
- Address
DATA_ADDRin TIA Portal is 0-based. The documented register 40001 is entered as0; an offset of 40001 produces exception 0x02 (STATUS 0x8383), which is a different failure mode. - Implement a diagnostic latch for STATUS in OB1 so future occurrences are timestamped and correlated with compressor mode transitions and any slave firmware updates.
What does TIA Portal MB_Master STATUS 0x8382 actually mean?
STATUS 0x8382 indicates that the Modbus RTU slave returned an exception response. The dominant interpretation in TIA Portal V15.1 Update 1 and later is that the slave answered with exception code 0x03 ILLEGAL DATA VALUE, meaning the request frame structure or value was rejected. In some TIA versions the same code is also produced when the response header is malformed. See the TIA Portal online help shipped with your installed version for the exact wording.
Can I write a single bit to a 16-bit Modbus holding register (4xxxx)?
No — Modbus RTU has no native single-bit write against a 4xxxx holding register. The write function codes 0x06 and 0x10 always operate on whole 16-bit words. The supported approaches are: (a) read-modify-write the entire word using FC 0x03 followed by FC 0x06 or 0x10, or (b) target a coil (0xxxx) address that the device exposes as a mirror of that bit, using FC 0x05 for a single bit.
Why does my Ingersoll Rand compressor return 0x8382 on every write to register 40001?
The most common cause in field reports is that the compressor is in Local, Off, or Standby mode. The Modbus port is alive and answers the request, but the slave firmware rejects control writes with exception 0x03 unless the unit is in Remote. Switch the controller to Remote via the keypad/HMI, then retry the write. STATUS should clear to 0x0000 once the unit confirms the new mode.
How is the TIA Portal DATA_ADDR offset interpreted for holding registers?
TIA Portal treats DATA_ADDR as a 0-based offset. A documented Modbus register 40001 must be entered as 0, register 40002 as 1, and so on. Entering 40001 directly shifts the request by 40001 registers and the slave responds with exception 0x02 ILLEGAL DATA ADDRESS, which the master reports as STATUS 0x8383 — a different code than 0x8382 but easily confused with it.
Is STATUS 0x8382 the same as a serial-port or PROFIBUS/PROFINET error?
No. The 0x80xx cluster is the Modbus application-layer error group. If the underlying physical layer (RS-485 termination, baud, parity, cable) is healthy enough for the slave to answer, the PLC bus is fine. If you see 0x8380 (timeout) instead, the issue is at the physical/link layer — check termination (120 Ω at both ends), baud rate (typically 9600 or 19200), 8E1 framing, and slave address DIP switches before suspecting the application layer.