Modbus TCP/IP slave variables v2

BM-GW as a Modbus TCP/IP slave (server).

UPS

ui = UPS index (1-32)

var	Unit ID	address	type	scale	description
ups_status	ui	0	int	-	UPS status (0 = disabled, 1 = OK (all strings OK), 2 = ERR (at least one string error))
ups_voltage	1,2	long	0.01	UPS voltage (average of strings voltages) [0.01 V]
ups_current	3,4	long	0.01	UPS current (sum of string currents) [0.01 A]; + = charge, - = discharge
ups_soc	5	int	1	UPS state of charge (average of strings SOC) [%]

Strings

si = string index (1-32)

var	unit ID	address	type	scale	description
string_ups_id	100 + si	0	int	-	UPS id where the string is connected (1..32; 0=not connected/disabled)
string_status	1	int	-	String status (0 = disabled, 1 = OK, 2 = Error)
string_voltage	2,3	long	0.01	String voltage [0.01 V]
string_current	4,5	long	0.01	String current [0.01 A]; + = charge, - = discharge
string_soc	6	int	1	String state of charge [%]
string_balance	7	int	0.01	String balancing state [0.01 %]
string_state	8	int	-	0=floating charge, 1=equalizing charge, 2=discharge, 3=idle, 5=abnormal
string_alarm	9	int	-	bit coded; b0=current hi (charging), b1=current lo (discharging), b2=voltage hi, b3=voltage lo, b4=SOC lo, b5=SOH lo, b6=hall disconnected
string_cell_count	10	int	1	Number of string cells
string_ambient_temperature	11	int	0.1	String ambient temperature [0.1 °C]
string_ambient_humidity	12	int	0.1	String ambient relative humidity [0.1% RH]
string_relay_status	13	int	String relay status (0=open, 1=closed)
string_aux_input_status	14	int	String auxiliary input status (0=off, 1=on)

Cells

si = string index (1..32); ci = cell index (1..120)

var	unit ID	address	type	scale	description
cell_status	100 + si	100 * ci + 0	int	-	Cell status (0=disabled, 1=OK, 2=error)
cell_voltage	100 * ci + 1	int	0.001	Cell voltage [0.001 V]
cell_resistance	100 * ci + 2,3	long	0.001	Cell resistance [0.001 mΩ]
cell_temperature	100 * ci + 4	int	0.1	Cell temperature [0.1 °C]
cell_soc	100 * ci + 5	int	1	Cell state of charge [%]
cell_soh	100 * ci + 6	int	1	Cell state of health [%]
cell_alarm	100 * ci + 7	int	-	Cell alarm (bit coded): b0=voltage hi, b1=voltage lo, b2=resistance hi, b3=SOC lo, b4=SOH lo, b5=temperature hi
cell_remaining_time	100 * ci + 8	int	0.1	Cell remaining time [0.1 h]

Legend

type
bit	1 bit (0..1)
int	16 bit signed (-32768..32767)
long	32 bit signed (-2147483648..2147483647)
scale
0.01	12345 ⇒ 123.45
origin
IC	Internal calculation
SS	String Sensor
MC	Master Controller