One situation in the field is easy to misjudge: the serial tool can see data, the gateway is also transmitting, and the device does not respond, or the value read back is clearly wrong. Levels on the line do not mean the protocol is already aligned. RS-485 only specifies a differential transmission method. The meaning of the data may be Modbus RTU, or it may be a vendor-defined protocol. A judgment has to start from at least three sides: serial parameters, device address, and frame format. In multi-brand access projects, Tongwei Smart uses the gateway for protocol access and data aggregation, and the platform for the device model, alarms, and work orders. What needs to be kept is the model, firmware, protocol version, point table, read and write permissions, and an acceptance sample, rather than the sentence “supports Modbus”.
The four serial parameters must match exactly
Baud rate, data bits, parity, and stop bits must be the same. For example, one end is 9600, 8E1 and the other end is set to 9600, 8N1. The line still has a waveform, but the receiving end may fail the checksum. Do not check only the baud rate. After changing parameters, save them as the device instructions specify. Some devices also need a power-off restart, or they return to the old configuration.
The slave address is the value actually saved in the device
On the same bus, addresses that take part in polling must be unique. When the address is wrong, the request is ignored by the other devices. When addresses are duplicated, two devices may respond at the same time and the frames collide. For an address set by DIP switches, a knob, or software, use the value actually saved in the device. Do not look only at the project list.
Check function code, address base, and data interpretation separately
Take Modbus RTU as an example. Reading holding registers, reading input registers, reading coils, and reading discrete inputs use different function codes, and the range a device supports also differs. 40001 written in the manual is not necessarily entered directly as 40001 in the software: some software uses zero-based addresses, and some uses one-based addresses. After a register is read, continue to check whether it is 16-bit or 32-bit, integer or floating point, signed or unsigned, the byte order, and the scaling factor.
Polling that is too dense can also appear as no response
Many devices have requirements for the polling interval, the response timeout, and the interval between consecutive requests. If the next command is sent before the previous one has finished being handled, the response may be lost or the device may return busy. During commissioning the interval can be lengthened. Turn off unnecessary high-frequency points first, and verify the device count and the sampling period separately.
When a broadcast has no return frame, check it against the protocol first
Modbus address 0 is usually used for broadcast writes. Several slaves can execute it, but a slave generally does not return a response. When what was captured is a broadcast write command, the absence of a return frame is not grounds to judge the device faulty. When start and stop, valves, relays, and other control actions are involved, also confirm the scope, the permissions, the interlocks, and the fallback method. Do not send write commands at will for the sake of a test.
Use a minimal protocol check to separate the device from the gateway
Connect only one master and one slave. First use a sample frame from the device manual to read one clearly defined status point, then hand the same frame to the gateway. If the serial tool can read a correct response and the gateway cannot, focus on the protocol template, the serial channel, and the point-table configuration. If the serial tool also cannot read it, go back to power, A/B polarity, function code, address, and device permissions.
When the value is wrong, check the interpretation first; changing the wiring is not the first step
The device has already returned data, but temperature, energy consumption, or electricity quantity on the platform is clearly wrong. Check the register address, data type, byte order, multiplier, unit, and timestamp first. Data being able to come up, and data being usable, are two different acceptance criteria.
Common questions
- The baud rate is already the same. Why is there still no response?
- Data bits, parity, and stop bits still have to be checked. 9600, 8E1 and 9600, 8N1 are not the same set of parameters.
- The manual says 40001. Is 40001 what you enter in the software?
- Not necessarily. Some software uses zero-based addresses, and some uses one-based addresses. Use the address base in the manual and the sample value actually read back.