Before sending anything
Use an authorised controlled bench with one device, known RTU serial settings and a known unit address. These examples use address 01; do not assume an unknown unit uses it. Do not use broadcast address 0, connect a second active master to a running bus, or scan arbitrary addresses. Isolate active loads and prevent unintended operation; qualified personnel must handle any hazardous wiring. A mains meter still requires its approved safe supply arrangement—these packets are not instructions for DIY live electrical work.
If you do not know the serial settings/address, obtain them from the label, setup display, saved configuration or vendor documentation. Do not change configuration to force a match. See the hardware-support checklist.
All frames below are complete RTU ADUs: unit address, function/data and two CRC bytes. Hexadecimal bytes are shown throughout. CRC covers every byte before the CRC and is transmitted low byte first. Line wrapping in a frame is formatting only, not a transmission pause.
Step 1: standard basic device identification
This is function 43 decimal (2B hex), MEI type 14 decimal (0E hex), read-identification code 01 (basic stream), starting object 00.
Request:
Code: Select all
01 2B 0E 01 00 70 77Code: Select all
01 2B 0E 01 01 00 00 03 00 10 45 78 61 6D 70 6C 65 20 43 6F 6E 74 72 6F 6C 73 01 07 44 45 4D 4F
2D 49 4F 02 03 31 2E 30 E6 F5- 01: addressed server.
- 2B 0E 01: identification service, basic stream response.
- 01: basic identification conformity, stream access only.
- 00 00: no more objects follow; next-object ID is unused/zero.
- 03: three objects follow.
- 00 10 followed by 16 ASCII bytes: VendorName = “Example Controls”.
- 01 07 followed by 7 ASCII bytes: ProductCode = “DEMO-IO”.
- 02 03 followed by 3 ASCII bytes: MajorMinorRevision = “1.0”.
- The final two bytes are the RTU CRC, not part of the revision string.
What this tests: whether this addressed device currently implements this identification request, and what identity it reports. It does not enumerate its I/O map or prove the reported identity is genuine.
A standards-based Illegal Function response to that request would be:
Possible exception reply:
Code: Select all
01 AB 01 9E F0Step 2: optional serial Report Server ID
Function 17 decimal is 11 hex. This is not function 17 hex, and it is not the FC43/14 identification service. It is serial-line-only and not universally implemented. Use it where the device's documentation permits it.
Request:
Code: Select all
01 11 C0 2CCode: Select all
01 11 06 42 FF 44 45 4D 4F CB 17The server-ID byte and additional bytes have vendor-specific meanings. There is no standard decoding that turns every such response into a model number. Length/content can vary; use the matching manual. An unsupported/not-allowable response could instead be:
Possible exception reply:
Code: Select all
01 91 01 8C 50Timeout is different from an exception
No reply could mean a wrong address, baud/parity mismatch, wiring/CRC trouble, unavailable device or gateway issue. Silence alone does not establish unsupported functions. Stop and check the known setup rather than advancing through a blind packet sweep.
RTU timing matters
Frames are separated by at least t3.5 character times; a gap greater than t1.5 character times within a frame makes that frame incomplete and it must be discarded. Character time is based on the serial character format, not just eight data bits. For baud rates above 19200, the serial guide recommends fixed t1.5 = 750 microseconds and t3.5 = 1.750 milliseconds. A serial adapter/library should implement this; do not paste individual bytes with long pauses. The device's response timeout is separate from these framing intervals.
All example CRCs were calculated and independently cross-checked in software. Nothing here was tested on hardware.
Sources
Modbus Application Protocol V1.1b3: sections 6.13, 6.21 and 7
Modbus Serial Line Guide V1.02: sections 2.2, 2.5.1 and Appendix B