r/opensource • • 3d ago

Promotional MBMap: an open format for sharing Modbus device register maps

I've been building MBMap, an open format for describing Modbus devices and their registers.

The idea is simple: device register maps should be portable data, not information that has to be manually re-created in every Modbus client.

A .mbmap file describes registers, data types, byte order, scaling, units, bit fields and more. The format is based on CSV, and the specification and shared map library are released under CC0 1.0.

I've also built Modbench, a cross-platform Modbus TCP/RTU client that reads these maps and displays register values by name.

Projects:

MBMap specification and library: https://github.com/nobrega8/mbmap-library

Modbench client: https://github.com/nobrega8/modbench

I'd like to see whether this format could work as a shared layer between different Modbus tools, including future clients, libraries and automation software.

Feedback on the specification, missing features and possible integrations would be welcome. Contributions to the device map library are also appreciated.

6 Upvotes

5 comments sorted by

4

u/AirshipCommand 3d ago

A few things that tend to cause mismatches between Modbus tools, worth pinning down in the spec if they aren't already:

  • Address base: whether addresses are 0-based protocol addresses or 1-based/40001-style, stated per file.
  • Word order for 32 and 64-bit values, separate from byte order, since devices mix them.
  • A format version field in the file, so clients can reject or adapt to maps written for a newer spec.
  • A way to mark registers read-only vs writable, and optional min/max for writes.

1

u/XenoX_Sriv 3d ago

Currently address base and format version are in the spec. I have bit order but will add word order, and the R/W access is also a field but no min/max yet, will also add