Explainer
Reading SunSpec Modbus devices into SCADA over Modbus TCP
Short answer
A standard Modbus TCP driver reads SunSpec devices. SunSpec only defines the register layout: a chain of model blocks starting at the device's documented base address, each block carrying a model identifier, a length, and int16 values you decode with per-block scale factors. The engineering work is block location and scaling, not a new transport.
On this page
- SunSpec is a layer, not a protocol
- A chain of model blocks, not a flat register map
- Scale factors turn int16 registers into engineering units
- Walking the block chain on a three-phase inverter at base 40001
- Keep each poll inside one block
- Writing setpoints carries the same risk as a PLC output write
- When to stop mapping directly and put a box in front
- Questions asked
Yes: the Modbus TCP driver you already have reads a SunSpec device. SunSpec is not a second protocol stacked on top of Modbus — it is an application-layer register model that fixes which holding registers hold which solar quantities and how each one scales. The transport stays plain Modbus TCP, so a client that reads holding registers and applies a per-tag scale factor is all the plumbing you need. The engineering work sits in three places: the base address, the block layout, and the scale factors.
SunSpec is a layer, not a protocol #
SunSpec Modbus defines common parameters and settings for monitoring and controlling distributed energy resources: inverter status, AC measurements, voltage-regulation and power settings. None of that touches the transport. The device is a Modbus TCP server with registers; your driver is the client. The connection side is the same checklist you run when exposing a PLC over Modbus TCP — listener enabled, port, unit ID, connection limits — except every item lives in the inverter's communication menu instead of the PLC project. The effort in a SunSpec integration goes into documentation and decoding, not into making the connection work.
A chain of model blocks, not a flat register map #
SunSpec memory is a chain of fixed-layout model blocks. Each block opens with two registers: the model identifier and the block length in registers. Model 1, the common block, is mandatory, comes first, and identifies the device — manufacturer, model, serial number. The device then appends the models it implements: 101 for a single-phase inverter, 102 for split-phase, 103 for three-phase, and the IEEE 1547-2018 mapping in models 709 and 710. The chain closes with a marker block, identifier 65535 (0xFFFF) and length 0.
Where the chain starts is the device's documented base address. SolarEdge, for one, documents the common block at 40001 in base-1 PLC addressing — the same register as 40000 in the base-0 protocol addressing most PC-side drivers use. Get this offset wrong by one and every tag reads shifted: the classic symptom is a length value sitting where you expected an identifier.
Discovery is arithmetic, not search: the next block's identifier sits at the current identifier's address plus 2 plus the current length.
Scale factors turn int16 registers into engineering units #
Nearly every measurement in a SunSpec block is a 16-bit signed integer, and each group of measurements is paired with a scale-factor register — also a signed int16 — holding a power of ten:
decoded value = raw × 10^SF
An SF of -2 means multiply the raw count by 0.01; an SF of 0 passes it through. Both sides are signed on purpose: negative watts report power flowing the other way, which a driver set to unsigned will destroy. In a driver with linear gain-and-offset scaling per tag, set gain = 10^SF and offset = 0, so SF -2 becomes gain 0.01.
The failures this causes are distinctive. A value off by a factor of 10 or 100 is a skipped scale factor. A value that is wildly wrong is register width or byte order, not scaling — fix the data type first, then the gain.
Walking the block chain on a three-phase inverter at base 40001 #
Inputs:
- The inverter's SunSpec map documents the common block at 40001 in base-1 PLC addressing — the convention SolarEdge documents. Your device's map states its own base; current inverter maps start in the 40000 holding-register range.
- The SCADA Modbus TCP driver polls base-0 protocol addresses.
- The unit is three-phase, so a model 103 block is expected after the common block.
- The register reads below (length 65, current 833, SF -2) are illustrative values of the kind the device returns; take the real ones from the live registers or the map.
Rule in words: convert the base by the driver's offset, read each block header, jump 2 + length to the next header, and decode each measurement as raw × 10^SF.
The arithmetic:
- Base conversion: 40001 - 1 = 40000. The first poll is two holding registers at protocol address 40000.
- That read returns identifier 1 — the mandatory common model, as expected — and length 65.
- Next header: 40000 + 2 + 65 = 40067. Reading there returns identifier 103, the three-phase inverter model, with its own length register.
- Inside the 103 block, the AC current register returns 833 and the current scale factor returns -2. Decoded current: 833 × 10^-2 = 8.33 A. In a gain/offset tag: gain 0.01, offset 0.
Decision: if 8.33 A matches the inverter's local display within rounding, the mapping is proven — lock it and replicate the pattern across the block. A result off by a factor of 10 or 100 means the scale factor was not applied; fix the tag gain, not the connection. An error or nonsense on the very first read means the base offset is wrong by one — poll one register either side of 40000 before changing anything else.
Keep each poll inside one block #
A Modbus server rejects a read that leaves its defined map, and a SunSpec map has a boundary at every block edge. Poll block by block — the two header registers plus the length the header announces — instead of one long read across the chain. A request that straddles a gap comes back with exception 02 and looks like an incompatibility; it is the same addressing failure as a Modbus read that crosses a register-map gap, and it is fixed the same way: split the poll at the documented boundary.
Writing setpoints carries the same risk as a PLC output write #
SunSpec is not read-only. The models that report voltage regulation and power output accept settings for them, and the 1547-2018 profile in models 709 and 710 is written that way. Where the device implements writable points, a SCADA write changes the behavior of an operating generator, so give it the guardrails you already use for safe Modbus writes to PLC output registers: one writer, an enable condition, and a defined state on lost communications. Never bind a writable model point directly to an operator entry field.
When to stop mapping directly and put a box in front #
Direct mapping in the Modbus TCP driver is the right call for one inverter with a stable, documented map: the block walk is done once, and nothing sits between SCADA and the device. It stops being the right call where a master aggregates several SunSpec devices into one register list — each connected device appends its blocks in sequence, so a device added or reordered upstream moves every later address — or where the map changes with firmware. Then concentrate the polling in a PLC data concentrator or a dedicated polling server, or run the SunSpec-to-OPC UA conversion on an industrial mini PC as a gateway host; a device that also exposes a JSON or native API can be polled there instead of through registers.
Decision: one inverter, documented map, static site — map it directly and move on. Chained devices, expected reordering, or firmware-driven map churn — put the polling in one box and hand SCADA stable tags.
Questions asked
Do I need a SunSpec-specific driver or OPC server?
No. SunSpec data is ordinary Modbus holding-register data, so any Modbus TCP client that can apply a per-tag gain reads it. A SunSpec-aware OPC server or gateway still earns its keep when many devices share one register list or the device order changes, because it walks the block chain for you instead of leaving fixed addresses in the SCADA database.
Why did my addresses shift after adding a device to the bus?
Where a master aggregates several SunSpec devices into one register list, each device appends its model blocks in connection order, so a block added upstream pushes every later block to a higher address. Re-read each header and length register and rebuild the affected tags; do not apply a fixed offset, because block lengths also vary with the models a device supports.
My read returns exception 02. Is the device incompatible?
No. Exception 02 means the address range you requested is illegal on that server: either the read ran past the end of a block or into a gap between blocks, or you used base-1 addresses in a base-0 driver. Split the poll at block boundaries using the length register, and try the base one register either way.
Can SCADA write setpoints through SunSpec models?
Yes, where the device implements the settings and control models, including the IEEE 1547-2018 mapping in models 709 and 710. Treat every write like a PLC output write: one writer, an enable tag, and a defined safe state on lost communications, because a stray value changes real voltage-regulation or power settings on an operating generator.