I am using Modbus_master_test Software to read several Registers of Kostal Solar Inverter. However it seems that only adress 4003 (Inverter Modbus On) is working properly. If I try to request adress 40005 I get meaningless values in the result array. (any non defined values). If I try to request higher adresses my Lan gets somehow disturbed..
I did a test using CAS Modbus Scanner, which works properly
Request UID of Inverter, which shall be the value of Addr 04
Request:
$47 = ID of Inverter
$03 = function code
$04= addr
$01=Number of Bytes
[08:24:28] => Poll: 47 03 00 04 00 01
Response:
$47 = ID of Inverter
$03 = function code
$01=Number of Bytes
$47=Content of register
[08:32:49] <= Response: 47 03 02 00 47
Arduino Code: (Is this correct?)
int regs[100];
const int SMA_UID = 71;
res = modbusRequest(SMA_UID, 40003, 1, regs);
reg[0]=??? //shall be 71??
if you want the value of register "well-known value. 1 Uniquely identifies this as a SunSpec Common Model block" then use address 40002, because addresses in docs are 1 based and the system has them 0 based
thanks a lot for your great support. I can read the registers now!!!
Just another related problem: how to convert the 4 byte register into float varaible. See attached screenshot. I would need the float32 value in my code.
thanks a lot for your great support. I can read the registers now!!!
Just another related problem: how to convert the 4 byte register into float varaible. See attached screenshot. I would need the float32 value in my code.