OTDeck

Docs · Protocols

Register maps, the device library and the Modbus scanner

OTDeck 0.3 adds three ways to fill the Modbus register browser without typing every range: import a register map file, add a device from the built-in library, or scan the device. All of them end in ordinary ranges that you can edit (Edit range), poll, trend and give to AI agents.

Scale, unit and description

Every range has three optional fields:

  • Scale: a multiplier from the raw register value to the engineering value. A voltage register that counts tenths of a volt has scale 0.1: raw 2305 shows as 230.5. Scale applies to numeric types (int16 to float64), not to bool, hex or string. The register browser, trends and read_registers show the scaled value; the raw value stays visible (hover the value, or the raw_value field for agents).
  • Unit: V, kWh, °C… shown after the value and in trend labels.
  • Description: a note from the manual.

Writes to a scaled holding register take the engineering value: writing 230.5 at scale 0.1 sends raw 2305. A value that is not a whole raw number (230.55 at scale 0.1) or does not fit the type is refused with the reason. The write dialog shows the raw value before you send it, and the approval window of an agent write shows the exact registers.

CSV register maps

Register map → Import CSV… reads a CSV, TSV or semicolon-separated file (UTF-8, with or without BOM; Excel’s sep=; line is understood), at most 2 MB and 5000 rows. The first line is the header; columns are found by name, case-insensitive:

Field Header names Values
name name, label, tag, parameter, signal text
table table, register type, area, function, fc holding / HR / 4x / FC03, input / IR / 3x / FC04, coil / 0x / FC01, discrete / DI / 1x / FC02
address address, register, offset, reference, start decimal, 0x0010 or 10h
data type data type, type, format uint16 (U16, word), int16 (S16), uint32 (U32, dword, acc32), int32 (S32, dint), float32 (float, real), float64 (double), uint64, int64, string, hex (bitfield16), bool
count count, quantity values, default 1
byte/word order byte order, order, endianness; word order, word swap; byte swap ABCD, CDAB, BADC, DCBA, big/little endian, yes/no
length length, size, registers registers per string
scale scale, multiplier, factor, gain 0.1, 0,1, 1/10, /10, 10^-1
unit unit, units, uom text
description description, comment, notes text

Only an address column is required; the table defaults to holding registers and the type to uint16. Bare digits in a table column (3, 4) are refused as ambiguous unless the column is called function or FC.

Addresses. Manuals number registers three ways, and the import asks which one the file uses:

  • 0-based protocol addresses: what goes on the wire (holding 0 is the first register).
  • 1-based register numbers: register 1 is protocol address 0.
  • References: the first digit is the table, 40001 is holding 0, 30001 input 0, 10001 discrete input 0, 00001 coil 0; six digits (400001) work too.

Detect looks at the header (address (0-based), register (1-based)) and the numbers (every address 30001/40001-like: references; a 0: 0-based; lowest 1: 1-based) and says why. Always compare two or three rows of the preview with the manual: the Ref column shows each row as a reference.

The preview lists every row with its problem (unknown type, address out of range, a string without its length) and warnings (overlapping rows, a scale on a hex value). Rows with errors are skipped. Choose Add to the current ranges or Replace; a connection polls at most 256 ranges.

Example:

name,table,address (0-based),type,count,order,length,scale,unit,description
Phase 1 voltage,input,0,float32,1,,,,V,
Total active energy,holding,342,uint32,1,CDAB,,0.01,kWh,Resettable
Serial number,holding,64512,uint32,1,,,,,
Device name,holding,40,string,1,,8,,,
Pump run,coils,0,bool,1,,,,,

Export CSV… writes the current ranges in exactly this format (0-based addresses), so a map can be edited in a spreadsheet and imported again or shared with a colleague. Texts that start with =, +, - or @ get a leading ' so spreadsheet programs do not run them as formulas; the import removes it.

Device library

Register map → Add from library… lists built-in maps of common devices. Each was copied from the vendor’s own register document (or the SunSpec model definitions); the dialog shows the document, its version, how its addresses were converted, the documented serial defaults and unit id. After adding, check the connection’s unit id and serial settings against the device; OTDeck does not change them.

Device Source
Eastron SDM120 SDM120 Modbus protocol V2.4
Eastron SDM120CT SDM120CTM Modbus protocol V1.3
Eastron SDM230 SDM230 Modbus protocol V1.1
Eastron SDM630 SDM630 Modbus protocol V1.8
Carlo Gavazzi EM540 (EM530) EM530/EM540 Modbus communication protocol V1.3, 2024-02-13
Schneider Electric iEM3255 (iEM3150/3155/3250/3350/3355) iEM3100/iEM3200/iEM3300 user manual DOCA0005EN-16, 05/2026
ABB B23/B24 B23/B24 user manual 2CMC485003M0201 Rev. E, 2025-11-07
SunSpec inverter, three-phase (model 103) SunSpec models, model_1 and model_103
Victron Energy GX (system values) CCGX Modbus TCP register list 3.81

The SunSpec template assumes the common layout: SunS at 40000, model 1 at 40002 (length 66) and model 103 right after it at 40070. Devices that put other models first, or start at 0 or 50000, need the addresses shifted; the description of each value names its scale factor register.

The same files build the device pages on otdeck.com/modbus/devices.

Modbus scanner

Scan… in the Modbus view sends read requests only (functions 01–04), never writes. While a scan runs, polling of the connection pauses. A scan can be stopped at any time and stops when the connection closes; it sends at most 20 000 requests and is logged in the app log.

Unit ids (free): tries unit ids 1–247 (any range up to 255 on Modbus TCP and Modbus UDP; on RTU, directly or through an RTU over TCP or UDP gateway, 0 is the broadcast address of the serial line and not scanned) with one read, by default holding register 0, with a short timeout (200 ms on RTU, 300 ms on TCP). A reply, or an exception such as Illegal data address, means a device answered; a timeout, or a gateway’s exception 10 or 11, means nothing is there. Many Modbus TCP devices answer every unit id. Use this unit id saves the found id in the connection; the scan itself never changes it.

Registers (Pro): reads one unit id’s tables in blocks of 125 registers (1000 bits) over an address range, 0–9999 by default. A block that fails is halved until single registers, so the readable runs are found exactly. The result lists each contiguous run with its first values; select runs and Add selected as ranges (uint16 for registers, bool for bits), then set the types from the manual. A large empty range costs many requests: narrow it when the request cap is reached.

On a production connection the scanner asks for the connection name, like a write, and sends at most 10 requests a second.