Troubleshooting
Why S7-200 MODBUS_SLAVE reports error 10 on HoldStart overlap
Short answer
MODBUS_SLAVE error 10 means the holding-register start address in HoldStart falls inside the V-memory block the Library Memory dialog reserves for the Modbus library, here VB0 to VB779. The library refuses a register table that overlaps its own working memory. Point HoldStart above the block, for example &VB800, so no exposed register byte shares library memory.

On this page
MODBUS_SLAVE reports error 10 when the address in HoldStart falls inside the V-memory block that the Library Memory dialog reserved for the Modbus slave library, and the same error clears once the holding-register table sits above that block. The reserved range is the library's private working memory: request buffers, protocol state and internal variables. A table that shares bytes with it would let a master write destroy library state and let the library destroy register data in return, so the library checks the pointer against its range and refuses the overlap instead of running corrupted. In the installation this article tracks, the library block was VB0 through VB779 and HoldStart pointed at &VB0; moving the table to the first byte above the block removed the error, and MODSCAN then read and wrote the registers normally.
What the MODBUS_SLAVE error output tells you #
MODBUS_SLAVE drives an error output that holds a nonzero code when the library cannot serve requests and 0 once it runs. In the installation above, that output read 10 with HoldStart aimed into the library block and 0 with the table based above it, while baud rate, parity, mode and slave address stayed untouched. A fault that switches with the HoldStart pointer alone is a memory-placement fault; prove the pointer clear of the reserved range before you touch anything on the serial side.
The help installed with your library defines each code, and the meanings are tied to the library version, so read the definition there instead of from a remembered list.
Sort the fault families by what they touch:
- Library configuration: a nonzero code on the error output from the first scan, independent of master traffic. Compare the HoldStart pointer with the range assigned in your project.
- Serial link: timeouts, framing trouble or exception responses at the master while the error output stays 0.
Two serial-side faults look nothing like this one. With the unit-address byte misconfigured, Modbus RTU sends to slave address 0 instead of your device. And while a programming session holds the port, an S7-200 cannot share one RS-485 port with a PC and Modbus traffic, so the master simply gets no reply.
What the Library Memory range is for #
Calling the Modbus slave instructions commits the library to keeping its protocol state in V memory, and the Library Memory dialog in STEP 7-Micro/WIN assigns one contiguous block for that state when you compile. The range is a reservation, not a data table: assigning it creates no readable registers, it marks bytes as taken so nothing else in the project uses them. Read the first and last byte from the dialog in your own project rather than assuming any remembered default.
HoldStart is a separate thing. It points to the first byte of the holding-register table, the area the master reads and writes. The table serves holding registers, the read-write half of the map, a split explained in holding register versus input register; each register is a 16-bit word occupying two consecutive V-memory bytes.
Every table byte accepts writes from the master, so keep anything your safe-stop or interlock logic depends on out of the table and treat incoming register writes as untrusted commands; the discipline for safe Modbus writes to PLC output registers from SCADA applies to any polling master.
Why the library refuses an overlapping table #
The library writes to its reserved block continuously while it services requests, and the master writes table bytes at arbitrary moments. Shared bytes would let a master write overwrite protocol state mid-transaction, and library housekeeping would in turn corrupt register data the master believes it wrote. The library therefore checks the HoldStart pointer against its reserved range and raises the conflict on the error output: a visible configuration fault instead of silent corruption.
This failure pattern is bigger than one library. On other small controllers, application data that lands in memory the runtime has reserved raises the controller's own error code; one documented case is analog data ending up in reserved V-memory.
Placing a 100-register table above the 780-byte library block #
The inputs, each with its source:
- Library block: VB0 to VB779, assigned in the Library Memory dialog of the installation this article tracks.
- HoldStart candidate: &VB800, the first byte above the block and the base under which the link ran without error.
- Table size: 100 holding registers, an example size; substitute your master's real count.
- 2 bytes per register, the width of a 16-bit holding register.
The rule in words: register N sits HoldStart + 2 × (N - 1) bytes from the base, so N registers span 2 × N bytes, and every one of those bytes must lie above the block's last byte and inside the CPU's V memory.
The arithmetic:
- First register: VB800 + 2 × (1 - 1) = VB800, occupying bytes VB800 and VB801, the word VW800.
- Second register: VB800 + 2 × (2 - 1) = VB802, the word VW802.
- Last register, N = 100: VB800 + 2 × (100 - 1) = VB800 + 198 = VB998, occupying VB998 and VB999.
- Table extent: bytes 800 through 999, all above 780, the first byte after the block.
The result: a 100-register table based at the first byte above the block ends at VB999 and shares no byte with the library, and the 20 bytes between the two areas stay free.
The decision: in this installation, any HoldStart of VB780 or higher clears the overlap, provided base + 2 × N - 1 stays within the V-memory size of your CPU model from its datasheet. A base below that threshold leaves bytes inside the block and keeps the error; if the real register count pushes the end byte past V memory, serve fewer registers or relocate the library block instead.
Moving the table and proving the fix #
- Open the Library Memory dialog in your project and record the first and last byte of the assigned range.
- Count the registers your master actually reads and writes, double it for bytes, and choose a base byte above the block's last byte whose end byte stays inside V memory.
- Enter the & address of that byte in HoldStart and recompile the program.
- Search the program, symbol table and data blocks for other users of the chosen bytes. VB and VW names address the same bytes, so a word-sized tag elsewhere can collide with the table without an obvious warning; overlapping VB and VW addresses in S7-200 memory walks through finding and settling such collisions.
- Download and watch the error output of MODBUS_SLAVE in a status chart: expect 0 from the first scan, and no transitions while the master polls continuously for several minutes.
- Prove both directions. Force a known value into the first register word and confirm the master displays it, write a different value from the master and confirm the status chart takes it, then read the last served register and expect its value at base + 2 × (N - 1).
Habits that bring error 10 back #
- Reading the reserved range as a data table. Assigning it creates no registers; it removes bytes from the project's use.
- Copying a small pointer from remembered advice. &VB100 and &VB200 sit inside this installation's block, so they reproduce the overlap exactly; judge any proposed base against the assigned range, not against habit.
- Sizing the table without arithmetic. A base near the top of V memory with a large register count runs the table past the CPU's memory; compute the end byte as base + 2 × N - 1 before you commit.
- Leaving your own logic aimed at either area. PID data, drive communications or indirect pointers placed in the reserved range or in the table bytes get overwritten by whoever writes second, your program or the master.
The decision for every case: keep the library block and the whole register table disjoint, prove the disjointness with the byte arithmetic, and confirm it with a status chart on the error output and one known value polled end to end.
Questions asked
Can I move the library memory block instead of the register table?
Yes. The Library Memory dialog relocates the reserved block to an unused area, so a register table that the master and any operator screens already reference by fixed address can stay where it is. Prefer this when re-addressing the master would be harder than moving the reservation. Move the block clear of your program data and the table, recompile, download, and confirm the error output reads 0 from the first scan.
Why does the master show my first register at offset 0 or offset 1?
Modbus tools use different bases: some show the first holding register as 40001, others as offset 0 or offset 1 of a zero-based or one-based map. After a move, confirm the first word of the table matches what the master shows for the first register, then check a middle and the last register. A constant shift across the whole table points to the base setting in the tool, not to a misplaced table.
Does the S7-200 SMART Modbus RTU library need the same allocation?
Yes. The S7-200 SMART Modbus RTU library also requires a library instruction data area to be allocated before its instructions are called, and the same placement rule applies: keep the master's register table outside the allocated block. Record the range the allocation dialog assigns in your project, then base the table above its last byte, exactly as on the classic S7-200.
What happens if the master still polls the old register range after the move?
The vacated bytes return to ordinary program memory. If the master still polls the old range, it reads whatever your logic now keeps there and reports success, so nothing looks wrong until a value disagrees. Update the master's start register to the new table before trusting the data, and watch one known value through the whole path from the status chart to the master display.
Is the reserved block always this size?
No. The size depends on the Modbus library version installed with your programming software, so this article's range is one installation's allocation, not a constant. Open the Library Memory dialog in your own project, read the first and last byte it assigns, and place the register table above that last byte with its end inside your CPU's V memory.


