IMDTouchKnowledge BaseShop main store

Troubleshooting

Why unit ID 0 fixes a Modbus TCP device not responding

HMI and touchscreens Published 9 min read

Short answer

A Modbus TCP device that ignores the HMI can fail on the unit ID alone: in the worked case a Weintek cmt3162x in EasyBuilder Pro 6.08.02.322 connected to a process heater at 192.168.1.113 once the unit ID was set to 0, port 502 confirmed, and the unsupported 0x and 1x address mappings removed.

On this page
  1. Why does my HMI report device not responding on Modbus TCP?
  2. What does the unit ID do in a Modbus TCP frame?
  3. Which unit ID should my Modbus TCP client send?
  4. How do I fix device not responding in the HMI project?
  5. Why do 0x and 1x address mappings cause the same fault?
  6. How do I prove the connection before the machine runs again?
  7. When does the unit ID not explain the fault?
  8. Questions asked

A Modbus TCP server that stays silent usually fails the HMI on one field inside the request frame: the unit ID. In the worked case below, a Weintek HMI in EasyBuilder Pro could not read a process heater that demonstrably answered a desktop test client — the network, the port and the register selection were all sound, and the single change that cleared the device-not-responding message was the unit ID value in the driver settings. This article explains what the unit ID does in the MBAP header, which value each kind of server expects, why the 0x and 1x address mappings had to go, and how to prove the repaired connection with online simulation before the machine runs again.

Why does my HMI report device not responding on Modbus TCP? #

This fault means the HMI opened the TCP connection and sent a request the server never answered; in the worked case below the request was sound except for one field, and setting the unit ID to 0 cleared the message on the next download.

The message is a driver timeout at one of two layers. Either the TCP connection never opens, because the address, the port or the subnet is wrong, or the request goes out and no reply comes back inside the driver's timeout, because the server rejects the frame's contents or is too busy to answer. The causes worth checking, in the order they usually resolve:

  • Server and HMI port on different subnets, or a cable and switch path that is down.
  • A TCP port other than the one the server listens on.
  • A unit ID the server does not recognize, so it silently drops the request.
  • Register areas the server does not implement, so the read targets memory it does not have.

The heater in the worked case sat at 192.168.1.113 and answered a desktop test client throughout, so the connection layer was already proven and suspicion moved to the frame itself — which is exactly where the unit ID lives.

What does the unit ID do in a Modbus TCP frame? #

The unit ID is the one-byte routing field at the end of the seven-byte MBAP header that opens every Modbus TCP frame; a gateway uses it to pick the serial slave behind the TCP link, and a plain Ethernet server often checks it against its own configured identity.

Every Modbus TCP frame opens with the Modbus Application Protocol (MBAP) header, seven bytes long: two for a transaction identifier, two for a protocol identifier set to zero, two for the length and one for the unit identifier, followed by the same request data a serial frame carries. A server returns its reply carrying the same unit ID the request had, and a gateway that bridges TCP to an RS-485 bus routes by that field exactly as a serial bus routes by slave address, which is how one IP address can serve several logical devices — the unit ID, not the address, picks between them.

The client side is symmetrical. An HMI, a SCADA client or a PLC communication module all present the same three identifying settings — server address, TCP port and unit ID — and a PLC can hold the client role just as well; the same three fields decide its connection, as setting up a QJ71MT91 as a Modbus TCP client with scattered registers shows.

Which unit ID should my Modbus TCP client send? #

Send the unit ID the device documentation states, because the standard fixes the field's position in the frame but not its value: the heater in the worked case required 0, while a server descended from a serial device normally answers on 1.

The Modbus specification defines where the field sits and that the reply echoes it, but it leaves the required value to each server. Serial slave addressing runs from 1, so a server that grew out of an RS-485 product usually keeps 1 as its identity and clients connect without thinking about the field. A device designed as a pure Ethernet endpoint can enforce any fixed value instead, and a strict server that receives a different one simply drops the request: no exception, no reply, just the timeout behind the device-not-responding message.

Treat the unit ID as a per-device setting to verify, never a field left at whatever the project template supplied. The worked heater's documentation did not advertise the value and it was found by trial once the network had been proven; when a manual is silent, a two-value trial with a desktop test client settles it in minutes.

How do I fix device not responding in the HMI project? #

Edit the Modbus TCP device entry in the HMI project, set the unit ID the server requires, delete the address-mapping rows that point at register areas the device does not implement, then download and watch the registers update.

  1. Open the Modbus TCP device in the project's device list and confirm which HMI port the request leaves on; in the worked case one port sat on the machine subnet and the other on a different subnet, so only one could ever reach the server.
  2. Check the server address and TCP port against the table below; 502 is the standard Modbus TCP port and the heater listened there.
  3. Enter the unit ID the device requires — 0 in the worked case — in the driver's unit ID field, beside the address and port in the device settings window.
  4. Open the address-mapping table in the same settings window and delete every 0x and 1x row; the device's Modbus manual lists no coil or discrete-input area, so those rows targeted memory the server does not have.
  5. Point the screen objects straight at the register areas the device implements, using the addresses in the table below.
  6. Compile, download to the HMI and confirm each numeric object shows a live value instead of the fault text.
Setting Worked case
HMI and project tool cmt3162x with EasyBuilder Pro 6.08.02.322
HMI LAN1 192.168.1.100, machine subnet
HMI LAN2 192.168.8.10, separate subnet, no route to the server
Server address 192.168.1.113
TCP port 502
Unit ID 0
Start/stop command holding register 40001
Current temperature input register 30011
Bath level input register 30042
Input-register area begins at 30001

These are the worked case's values; substitute the address, port, unit ID and register numbers your own device documents.

Why do 0x and 1x address mappings cause the same fault? #

Delete any 0x or 1x address-mapping rows when the device documentation lists no coil or discrete-input area: those mappings send reads into register areas the server does not implement, so the reads fail and surface as the same device-not-responding fault.

Modbus notation splits data into four areas: 0x entries address coils, 1x entries address discrete inputs, 3x entries address input registers and 4x entries address holding registers. An address-mapping row in the driver translates one area into another, so a project whose objects route through 0x or 1x makes the client send coil and discrete-input reads to a server that implements neither. A talkative server answers with an illegal-function or illegal-data-address exception; a quiet one drops the request and the driver times out, which looks identical to the unit ID fault. The worked heater implemented the 3x and 4x areas only, so the fix was to delete the mapping rows and address the registers directly.

Offset conventions are the next trap. The input-register area begins at 30001, so 30011 is the eleventh input register and 30042 the forty-second; a driver that takes a zero-based offset wants 10 and 41 (30011 - 30001 = 10, 30042 - 30001 = 41), while a driver that takes the documented number wants 11 and 42. The evidence for this project does not record which convention the driver applied, so if an object reads a neighbouring value once communication is up, that offset is the first thing to check. The same family of register-number drift is covered in fixing Modbus TCP addressing errors between an HMI and a PLC.

How do I prove the connection before the machine runs again? #

Prove the connection with the HMI's own online simulation against the live device, and confirm the fixed registers update and the start/stop write lands before the project goes back on the machine network.

Run online simulation from the engineering PC with the device connected: the project then talks to the server through the same driver settings the downloaded project uses, so a live temperature and level on screen proves the unit ID, the port and the register selection together. The bench setup for this is covered in testing HMI simulation against a live PLC.

A desktop test client proves something narrower: that the server is reachable and which unit ID it accepts. The worked heater had answered such a client all along, which is exactly why that success could not clear the HMI — the HMI was still sending the wrong field. Treat the two tests as separate evidence and keep both in the record.

Put the start/stop write test on an isolated bench with the heater in a safe state, because a start command into live process equipment is a real hazard.

When does the unit ID not explain the fault? #

Changing the unit ID fixes this fault only when the server checks the field; work down the causes in order — reachability, then the unit ID, then the register areas — and the last test that succeeds tells you which layer to change.

  • Nothing answers, not even a desktop test client: stay on the connection layer. Check that the server and the HMI port share a subnet and that the port number is the one the server listens on; the worked case's second HMI port sat on 192.168.8.10 and could never have reached the machine subnet.
  • A test client reads but the HMI does not: copy the client's unit ID and register settings into the HMI device entry and retest. This was the worked case.
  • The server sits behind a serial-to-TCP gateway: the unit ID must equal the target slave's serial address, and the gateway's exception response tells you the TCP side is healthy and the routed serial side is not.
  • The message appears on an RS-485 serial link instead of Ethernet: the causes move to wiring, biasing, termination and slave address, as fixing HMI Modbus device no response over RS-485 sets out.

For a device like the worked heater, the unit ID was the change that cleared the message: set it to the value the server requires, keep the register objects in the areas the device implements, and prove both with online simulation before the download goes to the machine.

Questions asked

What is the transaction identifier for in a Modbus TCP frame?

It is the first two bytes of the MBAP header. A client sends a new value with every request on the same TCP connection and the server returns it unchanged, so the client can pair each reply with the request it belongs to when several are in flight. It never selects a device; that is the unit ID's job. A wrong transaction value mispairs replies, while a wrong unit ID produces no reply at all.

What does exception code 11 from a Modbus TCP gateway mean?

Exception 11 means gateway target device failed to respond: the gateway accepted the TCP request but the serial slave named by the unit ID did not answer behind it. Exception 10, gateway path unavailable, means the gateway itself could not route the request, for example because its serial port is closed. Both prove the TCP side is healthy and push the fault onto the routed serial side, so check the slave address, wiring and termination rather than the HMI project.

The manual lists no unit ID - what do I try first?

Try 1 first, because servers descended from serial devices keep the serial slave numbering, which runs from 1; then try 0, the value the worked heater required. Change the value in a desktop test client rather than the HMI so each trial takes seconds, and remember a server that echoes the field back accepts any value. Once one value reads registers, enter it in the HMI device settings.

Can two HMIs use different unit IDs against the same server?

Yes. The unit ID travels with each device entry in the project, not with the network, so two stations can carry different values and both work where the server honors them. The server returns each reply carrying the same unit ID the client sent, which also gives you a packet-capture check: if a reply comes back with a different value than the request carried, an intermediate gateway rewrote it, and that gateway is dictating the requirement.

Keep reading

  • How-to

    HMI Modbus TCP client and server roles with no device driver

    With no dedicated driver, the HMI works as the Modbus TCP client and the controller's virtual Modbus TCP slave as the server that answers on port 502. Add and activate the virtual slave in PiCtory, add the generic Modbus TCP/IP device in EasyBuilder Pro, and take every register number from the server's process-image map — one register per two bytes of process image, so byte offset 20 is register 10.

    HMI and touchscreens

  • Troubleshooting

    Fixing Modbus TCP Addressing Errors Between an HMI and a PLC

    An HMI 'device not found' alarm over Modbus TCP usually means the panel sent a request outside the PLC's mapped registers, not that the network is down. Convert the PLC's byte offsets to register addresses with HMI address = 40000 + byte offset / 2, so a REAL at 100.32 becomes 40016 and 100.36 becomes 40018, and allocate booleans from 100.16 so the driver's grouped 16-bit read stays inside the mapped base.

    HMI and touchscreens

  • Explainer

    Why EasyBuilder Pro PC simulation stops after 15 minutes

    Yes, up to a point you cannot log on. EasyBuilder Pro online simulation polls an RS-485 meter from the PC through a USB converter, but Weintek documents a 10-minute limit when the target device is connected directly to the PC, so the session ends and needs a manual restart. Prove the link in simulation; run the hourly log on an operator panel or a dedicated logger.

    HMI and touchscreens