IMDHMIControls LibraryShop main store

Troubleshooting

Why MB_CLIENT shows STATUS 16#0000 but no data arrives

Industrial networks Published 7 min read

Short answer

A no-error STATUS of 16#0000 from MB_CLIENT certifies that the request cycle completed, not that the values reached the receive array. With an empty array, audit the request definition first: make the address span satisfy end minus start equals quantity minus one, set the unit identifier the converter forwards to the downstream slave's ID, and give the bit-type objects a destination of the matching type. Until those three checks pass, treat the clean status as unproven.

On this page
  1. What the no-error status certifies
  2. Make the span survive subtraction
  3. Set the unit identifier a gateway forwards
  4. Declare where ten bits land
  5. Worked example: auditing ten input coils behind the converter at 10.76.1.101
  6. The check order and the decision at each step
  7. Questions asked

STATUS 16#0000 is MB_CLIENT's no-error result, and it certifies one thing only: the request cycle ran to completion. It is not evidence that the ten values reached the receive array. When the status stays clean while the array stays empty, the fault is in the request definition, not the link: the address span as entered does not survive subtraction, the converter forwards the unit identifier inside the request, and ten bit-type objects need a destination that declares where the bits land. Repair those three items against the device document, re-read, and only then judge the status. The worked example below runs the arithmetic for the reported case: ten input coils read from a CPU at 10.76.1.100 through the converter at 10.76.1.101.

What the no-error status certifies #

STATUS reports the outcome of the instruction's last completed job, and 16#0000 is its no-error entry. The instruction certifies its own work: the send, the wait, the receive inside its timeout. It cannot certify that the objects you meant to ask for are the objects the request named, or that the reply landed in the tags you watch.

Two documented behaviors sharpen the picture. A connection problem is reported in STATUS only after the configured repeated connection attempts have run, so an early clean reading proves less than it appears to. And the connection ID and the instance DB belong together in pairs, unique per connection: watch the DB that belongs to the call that actually runs, because a second MB_CLIENT aimed at the same server can lock reads out entirely, which is the failure described in Why two MB_CLIENT instances stop Modbus TCP reads from one server. The mirror-image fault, an error raised although the response itself is valid, is a different case covered in Why MB_CLIENT reports 16#80A3 on a valid Modbus TCP response.

Make the span survive subtraction #

A read of ten consecutive objects is defined only when the end address equals the start address plus the quantity minus one. The range entered in the reported case, 12258-122562, fails that test, and the worked example below shows the subtraction. Two conventions produce entries like this. Device documents often print displayed reference numbers that carry a leading class digit, the way 40001 marks the holding-register space, and a display number sits away from the protocol address by that digit and by the one-based display convention. Confirm from the device document whether it lists displayed references or protocol offsets, and enter the form your instruction documentation specifies for the library version in use.

Decision: if end - start does not equal quantity - 1, stop. No status value, clean or not, is interpretable until the span names exactly ten documented objects.

Set the unit identifier a gateway forwards #

MB_UNIT_ID corresponds to the slave-address field of a serial Modbus frame. A plain Modbus TCP server is addressed by its IP address, and the instruction documentation states that the unit identifier is then not used for the TCP addressing. A TCP-to-serial converter is the other case: the identifier travels inside the request and selects the downstream slave, and a serial slave answers only the requests that carry its own identifier.

The reported path reads a device with ID 1 through a converter, so the call must carry 16#0001; the 16#00FF shown in the instance DB forwards unit 255, which is not the slave that owns the data. Enter the identifier at the MB_CLIENT call so the running instance uses it, then re-read. On a non-gateway server the same change is inert, because the IP address does the addressing, so the correction cannot harm the link. Unit-identifier handling is one of the PLC-side settings covered in What you must configure on the PLC side for Modbus TCP.

Declare where ten bits land #

Coils and discrete inputs are bit objects: ten of them are ten bits, not ten integers. The MODE input of the MB_CLIENT call selects the Modbus function, reading coils, reading discrete inputs or reading registers, and the receive area must carry the data type that function returns, as the instruction documentation for the library version requires. The reported destination, DATI_RCV.DATI, is an array of ten integers holding a bit-type read; a zero-filled integer array proves nothing, because zeros are also what the array looks like before the instruction writes anything.

Decision: align the mode with the intended function, give the ten bits a destination of the required type, and judge the array only after the job's done signal has pulsed. One safety note: until the mapping is proven, keep these communication values out of any interlock and read that state from wired inputs.

Worked example: auditing ten input coils behind the converter at 10.76.1.101 #

The inputs, each with its source: ten discrete-input objects, the case's "input coils", from the request; the span 12258-122562, as entered in the request; the slave identifier ID 1, from the request; the identifier 16#00FF shown in the instance DB, from the reported configuration; the destination DATI_RCV.DATI, an array of ten integers, from the request; and a CPU1212C at 10.76.1.100 talking to the converter at 10.76.1.101 in TIA Portal V12, started from bit M4.0, all from the reported case.

The rule, in words: a ten-object consecutive read must satisfy end - start = 9; an identifier forwarded by a converter must equal the downstream slave's ID; a bit-type read needs a destination that declares where the bits land; and a no-error status certifies the cycle, never the mapping.

The arithmetic. Span: 122562 - 12258 = 110,304, while ten consecutive objects require 10 - 1 = 9. Because 110,304 is not 9, the span as entered cannot name the ten intended objects; at least one boundary is a displayed reference, a different base or a mistyped digit. Identifier: 16#00FF is 255 in decimal, and the slave answers ID 1; 255 is not 1, so a forwarding converter sends the request to a unit that will not answer. Type: ten bits have no declared landing inside ten integers, so even a successful transfer has no defined place to appear.

Result: the request is undefined on all three counts, so the clean status cannot be read as proof of arrival, and every diagnosis past this point is guesswork until the definition is repaired.

Decision: re-enter the span so end - start = 9 from the device document, set the call's identifier to 16#0001, and align the mode and destination type. Past that point the test means something: a completion that still leaves the array frozen then names the mapping or the watched tag, not the link.

The check order and the decision at each step #

  1. Run the span subtraction. End address minus start address must equal quantity minus one, as the worked example shows. If it fails, re-enter the addresses from the device document before any other test; no status is interpretable until this passes.
  2. Probe one object. Read a single object at the confirmed first address and compare it with the independent poller's reading, which the reported case says is non-zero. A match proves the addressing base; then scale to ten. A mismatch here means the base, not the link.
  3. Set the identifier the converter forwards. Enter the downstream slave's ID at the MB_CLIENT call, 16#0001 on this path, and re-read. Required on a converter path, inert on a plain TCP server.
  4. Confirm the pairing. The call's connection ID and instance DB must be their own unique pair; a reused pair lets a second instance lock the read out. Watch the DB of the call that runs.
  5. Align mode and destination. Select the function that reads the bit objects and give the ten bits the destination type the instruction documentation requires. Judge the array only after the done signal pulses.
  6. Toggle a live input. Switch the plant input behind one coil while the read cycles and watch the array online. A frozen array while the input toggles is an unwritten array; a changing element reveals where the bits actually landed.
  7. If all of that passes and the array still never changes under a clean status, verify that the tag you watch belongs to the running call's instance DB. That mismatch is the remaining way a completed copy can look like no data at all.

Questions asked

Is the value 16#00FF the same as unit identifier 1?

No. 16#00FF is hexadecimal for decimal 255, and a serial slave behind the converter answers only requests that carry its own unit identifier, so a request forwarded with 255 never reaches the device set to ID 1. Broadcast address 0 would be wrong here too, because the read must select one slave. Enter 1 at the MB_CLIENT call; the instance data block then shows 16#0001 on the next run.

If the quantity input had received the end address by mistake, what would the status show?

Probably a fault, not a clean result. A request for far more objects than a server answers in one read usually comes back as a Modbus exception, and MB_CLIENT reports that as an error status. That is why the clean completion here points away from the quantity and toward the start address, the forwarded unit identifier or the destination mapping. Enter the count of objects, ten for this read, never the last reference.

How can you prove whether any coil data is arriving at all?

Toggle the plant input that drives one of the remote coils while the read keeps cycling, and watch the receive array online. An array that never changes while the input toggles is not being written, whatever the status reports. If one element does change, note which one: its position shows where the ten bits actually landed inside the destination and exposes a mapping offset or a mode mismatch immediately.

What does the leading 1 in a reference such as 12258 mark?

Vendor documents commonly print Modbus references with a leading class digit that names the data space, the way 40001 marks the holding-register space; a leading 1 marks the discrete-input space. The display number is still not the protocol address. Enter the form your instruction documentation specifies for the library version in use, and confirm the base with a one-object read at the first address before scaling the request to ten.

Keep reading

  • How-to

    Set up a CLICK Plus as Modbus TCP client to an S7-1200

    Yes: make the S7-1200 the Modbus TCP server with MB_SERVER mapped to a data block of INTs, and make the CLICK Plus the client with Send and Receive instructions aimed at the CPU's IP address and port 502. Write the shared register map first; the S7 logic copies physical inputs into it and applies its output words to the real outputs.

    Industrial networks

  • Troubleshooting

    Fix Modbus TCP FC02 discrete inputs returning no data

    FC02 finishing with no error while the client BOOLs stay FALSE is a mapping fault, not a network fault: the server block's discrete-input buffer is BYTE storage, and unpacked bytes read back as zero bits. Declare the buffer in BYTE, pack each state into its bit, and match the requested range. The FC03 reads that already work prove the connection.

    Industrial networks

  • Troubleshooting

    Reading Modbus TCP from a ControlLogix PLC without a gateway

    Yes — ControlLogix reads Modbus TCP without a gateway card through Rockwell's sample Modbus TCP driver, but only on controller firmware version 20 or later with socket-capable Ethernet hardware such as a 1756-EN2xx module at firmware 5.007 or later. If either side misses the gate, use a standalone EtherNet/IP to Modbus TCP converter. When the driver runs, prove one request against a known-good PC client and match unit ID, start address and count field by field.

    Industrial networks