Troubleshooting
Why MB_CLIENT on an S7-1200 returns status 818C with an optimized DB
Short answer
MB_CLIENT status 818C means the instruction rejected MB_DATA_PTR: on the TIA Portal V14 Modbus library it points at an optimized data block. Clear optimized block access on the destination DB, or prove everything else with MB_DATA_ADDR 40002, MB_DATA_LEN 2 and MB_DATA_PTR MD50. For a PAC3200 with firmware earlier than V2.4.3, also set MB_UNIT_ID to 1 and run one Modbus TCP request at a time.

On this page
- What does status 818C on MB_CLIENT mean?
- How do I prove the chain with MB_DATA_PTR MD50?
- How do I disable optimized block access on the destination DB?
- Why does MB_UNIT_ID have to be 1 for a PAC3200?
- How many Modbus TCP connections does a PAC3200 accept?
- How many registers do a REAL and an LREAL need?
- Is 40002 the same register as 400002?
- What do statuses 80A5, 7002 and 0000 tell you?
- Questions asked
An S7-1200 that reports ERROR true with STATUS 818C on an MB_CLIENT call is not failing to communicate: the instruction has rejected the destination given to MB_DATA_PTR. On the TIA Portal V14 Modbus library the vendor documents 818C as a pointer that references an optimized data block, so the fix is to clear optimized block access on the destination DB. The fastest path is a two-register proof read into MD50 first, then the array; the PAC3200 adds two rules of its own — MB_UNIT_ID 1, and one Modbus TCP connection at a time on firmware earlier than V2.4.3.
What does status 818C on MB_CLIENT mean? #
On the S7-1200 and S7-1500 error list, 16#818C is a destination rejection: the vendor documents it for MB_CLIENT as an MB_DATA_PTR that references an optimized data block, so the request never leaves the PLC and no Modbus frame is sent.
Optimized block access is the default attribute of every new global DB in TIA Portal, which is why an untouched destination DB fails its first call: the register copy behind the MB_HOLD_REG area expects block-internal byte addresses that an optimized layout never exposes. Later STEP 7 releases word the same code more generally, as a pointer to the MB_HOLD_REG area that is not suitable, and how strict the check is follows the Modbus library generation that ships with the TIA release — MB_CLIENT version change after TIA Portal V16 migration tracks what moves when a project changes TIA versions. Because the test runs at parameter validation, ERROR appears immediately, the meter is never contacted, and cycling DISCONNECT cannot clear it. The project behind these codes ran on an S7-1212C, firmware V3.1, in TIA Portal V14. Decision: change MB_DATA_PTR or the block it points at — the network side never produces this code.
How do I prove the chain with MB_DATA_PTR MD50? #
Swap the pointer for bit memory and cut the request to one value: MB_DATA_ADDR 40002, MB_DATA_LEN 2 and MB_DATA_PTR MD50 move exactly two registers — 4 bytes, one 32-bit REAL — so every other part of the chain is tested without the DB.
Bit memory carries no block attributes, so this request cannot fail on pointer grounds. Trigger it on a rising edge of REQ: a DONE pulse with a plausible value in MD50, one that matches the meter's own display, proves the meter address, the port, CONNECT_ID, MB_UNIT_ID and the register addressing in one shot, and 818C then isolates the DB as the only remaining fault. If the MD50 request fails too, the DB was never the problem — continue with the unit identifier and the connection limit below. Whatever the outcome, let each attempt reach DONE or ERROR before touching a parameter; editing MB_DATA_ADDR, MB_DATA_LEN or MB_DATA_PTR while BUSY true corrupts the transaction in flight. Decision: MD50 completes, the DB is the fault; MD50 fails, the request identity is.
How do I disable optimized block access on the destination DB? #
Open PAC_BUFF under Program blocks, switch to its properties, clear the optimized block access attribute, recompile and download, and the same call that returned 818C — MB_DATA_LEN 100 into ARRAY[0..99] of REAL — completes with DONE.
A standard-access DB keeps fixed byte addresses inside the block, which is what the register copy behind MB_DATA_PTR needs on this library generation. Clearing the attribute and downloading re-creates the block, so every value in it returns to its start-up default until the first successful read fills the array again. Make the change with the process in a state where those defaults are harmless — it is the one step in this fix that can reach a running machine.
The call that worked once both fixes were in:
- REQ on a rising edge, DISCONNECT false while polling
- CONNECT_ID 1, unused by any other connection in the project
- MB_MODE 0, read holding registers
- MB_DATA_ADDR 40002, MB_DATA_LEN 100
- MB_DATA_PTR
"PAC_BUFF".DATA_PAC,ARRAY[0..99] of REALin the standard-access DB - MB_UNIT_ID 1, IP_PORT 502, meter at 192.168.0.5 with mask 255.255.255.0
Decision: after the download with optimized access cleared, the same full-length call into the array completes; no further change to the request is needed.
Why does MB_UNIT_ID have to be 1 for a PAC3200? #
MB_UNIT_ID rides inside the Modbus request as the unit identifier, and the PAC3200 answers to 1: with the default 255 the request is refused, and in this project the call only moved forward once MB_UNIT_ID changed from 255 to 1.
CONNECT_ID and MB_UNIT_ID are different identifiers in different places. CONNECT_ID selects a connection resource inside the S7-1200 and never leaves the PLC; MB_UNIT_ID is the unit field carried inside the request, and where many gateways tolerate a broadcast-style value, this meter wants its own unit. The unit change alone turned a hard error into a call that sat BUSY true — progress, not data, because the optimized-DB pointer still failed the request. Set the unit the server documents; for this meter it is 1. Decision: MB_UNIT_ID 1 for the PAC3200; CONNECT_ID is yours to allocate, one distinct value per MB_CLIENT instance, never one an HMI connection already claims.
How many Modbus TCP connections does a PAC3200 accept? #
The vendor's connection table gives the PAC3200 one Modbus TCP connection at firmware earlier than V2.4.3, so a second MB_CLIENT instance opened in parallel either steals the session or is refused — five datasets need five requests that run one after another.
This project collected them with five independent MB_CLIENT functions, each carrying its own MB_DATA_ADDR, MB_DATA_LEN and MB_DATA_PTR, called from OB1 one at a time by a five-step counter: pulse REQ, wait for DONE or ERROR, advance. A 100 ms timer alternating two requests through a normally open and a normally closed contact does the same job when two datasets are enough. Opening two instances against one server in the same cycle is a documented deadlock of its own — Why two MB_CLIENT instances stop Modbus TCP reads from one server works that failure separately. The serial discipline here comes from the meter, not from Modbus TCP: where the server allows several connections, Why parallel Modbus TCP clients beat one sequential poller shows how much faster parallel calls collect the same points. The one-connection row is tied to firmware, so read the installed version off the meter before designing either way. Decision: on firmware earlier than V2.4.3, serialize — one request, DONE or ERROR, then the next.
How many registers do a REAL and an LREAL need? #
A Modbus register is 16 bits, so one 32-bit REAL takes 2 registers and one 64-bit LREAL takes 4; the working request of MB_DATA_LEN 100 therefore returns 50 REAL values — 100 × 2 bytes = 200 bytes, and 200 / 4 = 50.
| Destination | Registers per value | Bytes per value | Values in a 100-register read |
|---|---|---|---|
| REAL | 2 | 4 | 50 |
| LREAL | 4 | 8 | 25 |
Size every destination by the same rule: bytes available must be at least MB_DATA_LEN × 2. The ARRAY[0..99] of REAL offers 100 × 4 = 400 bytes, twice the 200 bytes the request fills, so the full-length call fits once the DB is standard access. One array cannot hold REAL and LREAL elements together, and an LREAL value needs its own typed destination and its own MB_DATA_LEN of 4 registers per value; keep a REAL array and an LREAL array as separate members of one standard-access DB and run their request descriptors through the same sequential counter. If DONE arrives and the number looks implausible, the word order does not match the meter's register map — correct the interpretation before touching any scaling. Decision: 2 registers per REAL, 4 per LREAL, separate typed destinations, requests in sequence.
Is 40002 the same register as 400002? #
They are two spellings of the second holding register: the five-digit 40002 form and the six-digit 400002 form both mean offset 1 in the holding-register block, and MB_CLIENT takes the five-digit form in MB_DATA_ADDR.
Meter register tables often print the six-digit style, so translate rather than copy, and never enter a bare register number: leaving the holding-register base off is what comes back as Modbus error 8189, the invalid-data-address exception, and Why Modbus error 8189 needs 400001 added to the register address works that exact failure. The quieter trap is a request that completes with a plausible-looking value for the wrong point — an off-by-one address still returns a real number, so check the first read against the meter's own display before trusting the rest of the table. Decision: enter holding-register addresses in the 4xxxx form, then verify the first value against the meter display.
What do statuses 80A5, 7002 and 0000 tell you? #
Read the three states as a sequence: 80A5 means the request died before data moved, 7002 with BUSY true means it is still waiting on the meter, and 0000 after DISCONNECT true means the connection is released and it is safe to retry.
Work them in the order they appear:
- ERROR true, STATUS 80A5 — the first attempt in this project; the request was refused before any data moved. Walk the chain in order: meter IP address and mask, IP_PORT 502, CONNECT_ID, MB_UNIT_ID, then MB_DATA_PTR.
- BUSY true, ERROR false, STATUS 7002 — the transaction is in flight; one that never completes means the meter never answered, so re-check the unit identifier and the one-connection discipline before changing anything else.
- DISCONNECT true, STATUS 0000 — the connection is released; reconnect only after the cause is fixed, because cycling the connection repairs neither a rejected pointer nor a wrong register request.
- A meter that stops answering even a request proven with MD50 has a separate documented failure mode — Why some PAC3200 meters stop Modbus TCP and never recover covers it.
Decision, case by case: 818C — fix the destination, standard access or an M-area pointer; 80A5 or a stuck 7002 — fix the request identity and the one-connection discipline; values that arrive but read wrong — check addressing and word order against the meter's register table before recalibrating anything.
Questions asked
Do newer Modbus library versions still reject an optimized data block?
The strict 818C check belongs to the older Modbus library generation. From library version V4.0 on S7-1200 CPUs, and V3.x on S7-1500 CPUs, the vendor documents that MB_DATA_PTR may reference a single tag of elementary data type, or an array of elementary data types, inside a global DB with optimized access. One array still cannot mix REAL and LREAL elements, so separate typed destinations and sequential requests remain the rule.
Which memory can MB_DATA_PTR legally point to?
The vendor's error documentation allows two destination kinds for the MB_HOLD_REG area: a data block or an address in the bit memory area. MD50 is a bit-memory double word, so it occupies bytes 50 to 53 and answers the two-register REAL test without any block settings; it also survives DB downloads untouched, which makes it a tidy home for one proven value.
What does STATUS 7002 with BUSY true mean on the call?
7002 is the in-progress status: the request has been handed to the connection and no DONE or ERROR has come back, and it turns to 0000 once DISCONNECT true releases the connection. A 7002 that never completes usually means the meter never answered: with a PAC3200 limited to one TCP connection, rule out a second client holding the session and any parameter edited while the call was busy.
What should CONNECT_ID be for the PAC3200 reads?
CONNECT_ID selects a connection resource inside the S7-1200 and has no meaning on the meter, so any value no other instruction claims works. Take 5 or 6, for example, when an HMI connection already claims the low numbers, and give each of the sequential MB_CLIENT instances its own identifier so one counter step can never open two sessions at once.

