Protocol Manual
The design of Smarten Power 150 communication modbus map follows Sunspec infomation model
Different converter functions are categoried as differenct “Information Model”
The structrur looks like the follwoing table:
Model | Address offset | Absolute Register address | Value | What does it contain | |
—————————– | ————– | ————————- | ———- | —————————————————————– | |
Model ID | 0 | 0 | 1 | SunSpec compliant devices must include this as the first model\ | |
Model L | 1 | 0+1 | 66 | How many registers are there in Model ID 1 | |
Registers in model id 1 | 2 | 0+2 | |||
… | |||||
Registers in model id 1 | 67 | 67 | The last register in Model 1 | ||
Model ID | 0 | 67+1 | some ID | specific ID has specific definitions. listed in protocol document | |
Model L | 1 | 67+2 | some Lenth | How many registers are there in THIS Model | |
Registers in model id Some ID | 2 | 67+3 | |||
… | |||||
Registers in model id Some ID | some length+1 | 67+some Lenth | |||
… | |||||
Model ID | 0 | 0xFFFF | the last model | ||
Model L | 1 | 0 | there are no models following |
The Information Models that represent the functionality implemented in the device are placed contiguously in the Modbus address space at a defined location as specified in this section.
Modbus Address Location
All Modbus device maps are in the holding register address space.
The beginning of the device Modbus map is located at Modbus addresses in the Modbus holding register address space: 0.
These Modbus addresses are the full 16-bit, 0-based addresses in the Modbus protocol messages.
The first two Modbus registers at the start address have the following well-known constant values as a marker: 0x5375, 0x6E53 (hexadecimal values of the ASCII string SunS).
The Device Information Models is placed contiguously, beginning immediately after the SunS marker registers.
Each Information Model have registers corresponding to all the points in the Information Model, including those specified as optional or unimplemented.
Points in a model are placed such that there are no additional Modbus registers between points specified in the model definition. Points that are not supported or have no valid value MUST be assigned the appropriate unimplemented value based on the point type.
There are NOT additional Modbus registers between Information Models in the device Modbus map.
The length point (L) in an information model instance are set to the remaining number of Modbus registers in the model following the length point.
The last Information Model in the device Modbus map is a two-register empty model with a model ID of 0xFFFF and a model length of 0.
Device Information Model Discovery
A discovery mechanism can be employed to determine the type and location of each of the Information Models in the device map. Device architects may choose to implement different collections of Information Models in arbitrary order. In any implementation, after the Modbus address of a particular model is determined, the Modbus location of the points in the model are then known based on the model definition.
All Information Models start with an id register and a length register. This information is used to step through or scan the Information Models even if the ID and contents of an Information Model are not understood by the scanning application. This permits implementations to find and use the Device Information Model(s) they understand and ignore those whose definitions are unknown.
The following procedure is used for Information Model discovery:
1. Read the contents of addresses 0, 40000, and 50000 until the well-known marker is found.
2. Repeat the following steps until a model id of 0xFFFF is found:
1. Read the next two registers to get the ID and length of the next Information Model.
2. the length to the Modbus address of the next register after the length register to determine the starting address of the subsequent Information Model.
3. When this process is complete, the Modbus address and ID of each Information Model is known.
Modbus Functions
The Modbus interface comply with the Modbus standard for the functionality specified in this section.
The interface support
- function code 3 (Read Holding Registers)
- function code 6 (Write Single Register).
- function code 16(0x10) (Write Multiple Registers)
It support a Modbus serial (RTU) interface and/or a Modbus TCP/IP interface.
Value Representation
Scale factor
Signed power of 10 multiplier (+) or divider (-) As an alternative to floating-point format, values are represented by integer values with a signed scale factor applied. A negative scale factor explicitly shifts the decimal point to the left, and a positive scale factor shifts the decimal point to the right by the number of places specified in the scale factor value.
16-bit integers
16-bit integers are stored using one register in big-endian order.
32-bit integers
32-bit integers are stored using two registers in big-endian order.
64-bit integers
64-bit integers are stored using four registers in big-endian order.
128-bit integers
128-bit integers are stored using eight registers in big-endian order.
String Values
Store variable length string values in a fixed size register range using a NULL (0 value) to terminate or pad the string. For example, up to 16 characters can be stored in 8 contiguous registers as follows.
Modbus Register | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 | 5 | 6 | 6 | 7 | 7 | 8 | 8 |
————— | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | —- |
Byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Character | E | X | A | M | P | L | E | spc | S | T | R | I | N | G | ! | NULL |
NOT_IMPLEMENTED value: all registers filled with NULL, or 0x0000 It is recommended that an empty string be represented with the first register, with a value of 0x0080. Strings are UTF-8 encoded.
32-bit Floating-point Values
Floating-point 32-bit values are encoded according to the IEEE 754 floating-point standard.
64-bit Floating-point Values
Floating-point 64-bit values are encoded according to the IEEE 754 floating-point standard.