Coils
Single-bit read/write outputs such as run commands, relay outputs, resets, or binary actuator states.
3 reviewed answers.
Open the module page from the sidebar to see its chapters in order. Use the module map to return to a topic you need.
Modules and pathsReviewed
Check the symptom, then work through the diagnostic steps. Keep the error message and the smallest example that reproduces it.
When you are stuckReviewed
Use the interactive guide to check how examples and simulations work before changing your project.
Interactive examples guideReviewed
Progress saves as you read. Mark sections complete as you go; your progress appears in the sidebar.
This section: Start With the Number Behind the Register — Picture a heat meter that returns the number 517.
Prove What One Industrial Number Means
Picture a heat meter that returns the number 517. The screen should show 51.7 degrees, but only if the team chose the right location, scale, sign, and byte order. A reply is not proof that the value is correct.
Modbus is a small set of request and response rules used by industrial devices. It lets one side read or write bits and groups of 16-bit numbers. A gateway is a bridge that can carry those requests between unlike links. The device manual gives those locations their engineering meaning.
Start with one value the system will trust. Record the manual label, kind of object, number shown to people, number sent on the wire, size, read or write right, scale, unit, and byte order. Read a known physical state and compare it with a trusted check. Test a safe write only where the equipment plan allows it.
Keep transport faults separate from meaning faults. No reply, an error reply, a wrong value, and an unsafe write need different action.
Use Practitioner to build the register and polling record. Use Under the Hood to inspect serial frames, network wrapping, timing, gateways, and security limits.
Imagine a gateway reading “40017” from a heat meter and publishing it as supply temperature. The useful question is not whether Modbus returned bytes. The useful question is whether everyone agrees on the object family, wire address, scaling, byte order, permission, and physical check that prove the number is the right one.
Modbus works best when the register contract is visible. Start with one value a system will trust, then write down how the request, response, conversion, gateway path, and safety boundary preserve its meaning.
This section: Overview: Modbus Exposes a Register Contract — Modbus is a compact industrial request/response protocol for reading and writing device state.
Modbus is a compact industrial request/response protocol for reading and writing device state. Its stable idea is not a rich device model; it is a client asking a server for coils, discrete inputs, input registers, or holding registers. The engineering meaning comes from the device register map, not from the protocol alone.
That separation is useful and dangerous. It makes Modbus easy to bridge across serial and TCP paths, but it also means a dashboard value is only trustworthy when the object type, address convention, scaling, signedness, byte order, word order, write permission, and polling plan are recorded together.
For example, a heat-meter manual might label a supply temperature as holding register 40017, scale it by 0.1 degrees, and store a 32-bit value across two adjacent 16-bit registers. One client library may expect the human reference number, another may expect zero-based protocol address 16, and a gateway may pass only the function code plus address onward to a serial device. The register contract is the note that keeps those views aligned: it states the documented label, the object family, the address sent on the wire, the conversion rule, and the evidence that a known physical value decodes correctly.
If you only remember one rule, remember this: Modbus does not explain what a value means. The register map and integration record do.
Inspect Figure 5.1 to see why moving a Modbus operation is different from knowing what the addressed register means.
In Figure 5.1, follow the engineering application into the client, which asks a server to read or write device state. The protocol operation carries a function code and address over either a serial segment or a TCP connection; it does not carry the engineering definition of the value. Move to the heat-meter example and compare its manual view with the wire view. Two adjacent 16-bit registers provide 2 registers × 16 bits/register = 32 bits for one value, while the map separately supplies its scale and temperature meaning. The known physical value is the final check. A valid response frame can still be wrong engineering data if address, width, order, or scale is misread.
Single-bit read/write outputs such as run commands, relay outputs, resets, or binary actuator states.
Single-bit read-only inputs such as contact states, alarm bits, limit switches, and status points.
Read-only numeric values, commonly used for measurements, meter readings, and device-reported state.
Read/write numeric values, commonly used for setpoints, configuration, control words, and some status maps.
Start the evidence review for the “size and access”–“typical engineering meaning” decision: inspect Figure 5.2. Two labels deserve attention—“Size and access” and “Typical engineering meaning”—because they bound The four object families tell the client how the value can be accessed; the device manual tells the team what the value means.
Inspect “Size and access” on Figure 5.2, compare “Typical engineering meaning”, then ask what carries “Function-code family” into “Coils”. Their answers support The four object families tell the client how the value can be accessed; the device manual tells the team what the value means while keeping the “size and access”–“typical engineering meaning” decision connected to observable evidence.
This section: Practitioner: Build the Integration Record Before Polling — A useful Modbus integration record lets another engineer reproduce the connection without guessing.
A useful Modbus integration record lets another engineer reproduce the connection without guessing. It identifies the device, each value, the object family, the protocol address expected by the client or gateway, the engineering unit, the scaling rule, byte and word order, read/write permission, and the expected polling behavior.
The record also explains the transport path. Modbus RTU carries requests over a serial segment with device addresses, timing boundaries, and frame error checks. Modbus TCP carries the same application operation through a TCP connection with an application header. Gateways are the place where many mistakes hide because they translate an Ethernet request into a downstream serial request.
In a small pump-skid integration, the record should make each assumption testable before the polling loop is left unattended. Start with three or four points that operators can verify from the local panel: run status, commanded start, measured pressure, and a writable setpoint if writes are allowed. Capture the raw register values, decoded engineering values, function codes used, exception responses if a write is blocked, and the exact gateway route. Only then scale up the poll list, because a fast scan of badly mapped registers produces confident but misleading telemetry.
Use Figure 5.3 with “are only half the integration record” to inspect the next step in the “are only half the integration record”–“1 | the on-wire frame” decision. The relationship between “are only half the integration record” and “1 | The on-wire frame” is what makes Modbus RTU framing becomes integration evidence only when captured bytes, address convention, device-map meaning, and observed response agree reviewable.
Read Figure 5.3 from the on-wire address, function, data, and CRC into the vendor map that gives those bytes engineering meaning. A valid frame proves that the addressed device answered without a detected frame error; it does not prove that the chosen register, word order, scale, or unit is correct. Keep the captured request and response beside the map row and a known physical value. The illustrated story below follows that same evidence chain through a gateway, so watch where raw words become a named temperature.
1Gus sends one addressed read request to the meter.
2The meter returns a framed reply or a clear error.
3Gus maps the reply to the vendor register.
4He orders the words and applies the stated scale.
5The gateway sends the named value onward.
6A physical check proves the number means the right thing.
Read the six-panel story from Gus’s addressed request to the meter’s reply. The register map then ties the returned words to one documented value, after which Gus applies the required word order and scale. The gateway may forward that named temperature, but the last panel still compares it with a trusted probe on the same pipe. That physical check is what proves the decoded number means the intended process condition. The sequence separates communication success from engineering correctness and shows why a capture, map version, conversion rule, gateway route, and field observation belong in one integration record.
Inspect Figure 5.4 to see which MBAP fields track a TCP exchange and which field still identifies a downstream serial device.
Read Figure 5.4 by first splitting the application data unit. Its two parts are the MBAP header and the PDU. The header has three two-byte fields: Transaction Identifier, Protocol Identifier, and Length. It also has a one-byte Unit Identifier, so 2 + 2 + 2 + 1 = 7 bytes. The transaction field pairs each request with its response. The protocol field marks Modbus. At a gateway, the unit field selects the serial target. The PDU then states the function and its data. Keep gateway IP, transaction identity, and unit identity apart so one valid TCP exchange is not credited to the wrong field device.
Use Figure 5.5 with “port 502” to inspect the next step in the “port 502”–“gateway” decision. The relationship between “port 502” and “Gateway” is what makes Gateway boundaries need explicit mapping records so Ethernet clients do not hide serial timing and addressing assumptions reviewable.
Inspect “port 502” on Figure 5.5, compare “Gateway”, then ask what carries “MBAP Unit ID” into “maps to serial”. Their answers support Gateway boundaries need explicit mapping records so Ethernet clients do not hide serial timing and addressing assumptions while keeping the “port 502”–“gateway” decision connected to observable evidence.
This section: Under the Hood: Separate Protocol Failure from Data Meaning Failure — Good Modbus troubleshooting separates symptoms before changing configuration.
Good Modbus troubleshooting separates symptoms before changing configuration. A timeout, a serial frame error, an exception response, and a wrong engineering value point to different parts of the system. Treating every symptom as a generic network failure usually adds retries while leaving the real defect in the register map, gateway boundary, or security envelope.
Classic Modbus also lacks built-in user authentication, authorization, and encryption. That does not automatically force replacement, but it does require an explicit security boundary: allowed clients, blocked write paths where possible, controlled remote access, monitoring for unexpected function codes, and a documented plan for secure gateways or protocol alternatives when exposure or risk changes.
A useful triage pattern is to preserve the first failing request and classify it before tuning. No bytes back suggests reachability, serial settings, address, timeout, or gateway routing. A Modbus exception response means the server answered but rejected the operation, so function code, address range, permission, or device mode is the next evidence. A plausible response with an impossible value means decoding work: offset convention, scaling, signed interpretation, endian order, stale point mapping, or a wrong adjacent register. Keeping those buckets separate prevents a security or data-quality issue from being hidden behind more retries.
Start the evidence review for the “timeout, or intermittent failure”–“keep evidence categories separate before changing settings” decision: inspect Figure 5.6. Two labels deserve attention—“timeout, or intermittent failure” and “Keep evidence categories separate before changing settings”—because they bound Troubleshooting is faster when the evidence ladder separates link, address, function, encoding, gateway, and security questions.
Inspect “timeout, or intermittent failure” on Figure 5.6, compare “Keep evidence categories separate before changing settings”, then ask what carries “1. Link path” into “IP reachability”. Their answers support Troubleshooting is faster when the evidence ladder separates link, address, function, encoding, gateway, and security questions while keeping the “timeout, or intermittent failure”–“keep evidence categories separate before changing settings” decision connected to observable evidence.
Check physical path, IP reachability, serial settings, device address, gateway route, timeout, and retry behavior.
Compare function code, object type, address, value range, write permission, and device mode against the register map.
Review offset notation, scaling, decimal position, signedness, byte order, word order, and engineering units.
Review allowed clients, firewall rules, write-code blocking, change logs, remote-access path, and device mode.
Inspect Figure 5.7 to ask which clients may enter the OT segment, which operations they may issue, and what monitoring makes misuse visible.
In Figure 5.7, start outside the OT segment with controlled engineering access rather than a direct path to port 502. The boundary admits allowed clients and can block write functions that a read-only integration does not need. Inside, the Modbus gateway passes approved requests and responses to protected devices while monitoring looks for unexpected function codes. Read remote access as a separate control: a named route and session record are safer than an untracked workstation connection. The diagram does not add security to classic Modbus messages themselves. It shows where network filtering, authorization, write restrictions, and observation must stand before device data or control is exposed upstream.
This section: Summary — Modbus is useful because it is small and predictable, but that simplicity shifts responsibility into engineering records.
Modbus is useful because it is small and predictable, but that simplicity shifts responsibility into engineering records. The protocol defines object families, function operations, and transport mappings. The device register map defines meaning, scaling, write safety, and decoding. RTU, TCP, and gateway paths all need different evidence, and classic Modbus deployments need an explicit security envelope before values are exposed upstream.
This section: Key Takeaway
Modbus integration succeeds when the register map, address convention, encoding rule, transport path, gateway mapping, troubleshooting evidence, and security boundary are reviewed as one contract.
This section: See Also
Compare Modbus with richer industrial protocol families and the IT/OT boundaries around them.
Use selection evidence to decide when a simple register protocol is enough and when another pattern fits better.
Study how information models and built-in security change industrial integration design.
Review deterministic Ethernet choices when cyclic control behavior matters more than register polling.
3 reviewed answers.
Open the module page from the sidebar to see its chapters in order. Use the module map to return to a topic you need.
Modules and pathsReviewed
Check the symptom, then work through the diagnostic steps. Keep the error message and the smallest example that reproduces it.
When you are stuckReviewed
Use the interactive guide to check how examples and simulations work before changing your project.
Interactive examples guideReviewed