Modbus Read File Record: Keep File Numbers, Record Offsets and Word Counts Separate
A Modbus file read returns plausible numbers from the wrong location. Before adjusting scaling, separate the file number, starting record number and record length. File-record addressing is its own contract; copying a holding-register reference into the request can target the wrong data or produce an exception.

Key takeaways: Verify the selected file map, count 16-bit words correctly and preserve each sub-request's relationship with its returned data.
1. Read the file map first
Read File Record is Modbus function 20 decimal, or 0x14. The protocol's sub-request identifies a reference type, file number, starting record number and record length. The specified reference type is 6. These fields must be interpreted using the selected device's supported file organisation.
Do not treat a displayed holding-register number as a file-record address. Confirm whether the device supports the function and what its file contents mean at the installed firmware revision. If the manual describes only ordinary holding registers, do not infer that a similarly named file interface exists.
2. Separate words from bytes
Record lengths are expressed in registers, while request data lengths are expressed in bytes. Each returned register contributes two data bytes. Keep the protocol envelope and data payload separate when validating response length. Confusing these units can produce a valid-looking parser that consumes too much or too little of the next sub-response.
Use ProSense networking and gateway solutions to scope the device-to-host path and the selected driver's file-record support. A gateway that passes normal register reads successfully may still require a separately verified capability for this operation. Confirm the actual route rather than assuming that generic protocol support covers every function.

3. Keep grouped responses aligned
The function can read several groups, with sequential references within each group. A normal response contains a sub-response for each sub-request, including its own length information. Preserve those boundaries instead of concatenating everything into one unexplained vector and assigning engineering labels afterwards.
In a hypothetical test map, file 4 contains a documented two-word record starting at record 1, and file 3 contains another two-word record starting at record 9. Validate each group's response independently before decoding its engineering meaning. These illustrative addresses are not instructions for any product sold by ProSense and must not be applied to an operating device.
Practical verification checklist
Confirm function support and the device's actual file map.
Record file number, starting record and length with their units.
Validate each sub-response boundary before decoding data.
Compare raw words with known test values and engineering meaning.
4. Check boundaries before interpretation
Build a controlled fixture with recognisable word patterns and an explicit file map. Check the selected file, start record, word count and expected grouping. Include a wrong file reference and an unsupported request in the test plan so that the parser handles exceptions without labelling the response as measurement data.
Next verify the device-specific representation of multiword values, units and unavailable-data indicators. The file-read function transports words; it does not establish whether two words form a float, timestamp or application structure. Keep raw words and decoded values together during commissioning so that a plausible engineering display can be traced back to its source.
Field | Keep separate from |
File number | Ordinary holding-register reference. |
Record length | Byte length of the request or response. |
Returned words | Device-specific engineering interpretation. |
5. Recommended related solutions
Use ProSense networking and gateway solutions for communication-route and driver assessment. Discuss file-map interpretation, host parsing and acceptance tests through ProSense automation solutions. Specify the exact device, firmware and documented function support before selecting hardware or promising compatibility.
Bring a sanitised request and response, the manufacturer's current file map, the expected record definitions and the host's decoding rules to an enquiry. A useful acceptance record shows both raw words and the corresponding engineering result. Keep any testing on an approved isolated setup and preserve operating configurations.
Practical FAQs
Does every Modbus device support file records?
No. Verify the selected model, firmware and interface documentation.
Can a valid response still be the wrong measurement?
Yes. Confirm the file map and application decoding, not only the transaction's success.
Technical reference
Protocol definitions are from the primary reference. Hypothetical tests, diagnostic checklists and handover recommendations are original engineering guidance; confirm the selected device or endpoint contract.
Need help with your application?
Discuss your industrial integration with ProSense Solutions. Provide a sanitised trace, the actual interface or device documentation, required outcome and commissioning constraints.
.png)


